Comments (9)
Eureka🎉 I found the solution in the docs.
the maximum amount of time you are willing to wait for SMS auto-retrieval to be completed by the library. Maximum allowed value is 2 minutes. Use 0 to disable SMS-auto-retrieval. If you specifies a positive value less than 30 seconds, library will default to 30 seconds.
Thank you for your help!
from cordova-plugin-firebase-authentication.
And onAuthStateChanged is never called.
from cordova-plugin-firebase-authentication.
@cairinmichie I had a similar situation to yours.
The first thing I did when looking up this plugin was looking for "onAuthStateChanged" inside it but I also couldn't find it. Still I added this plugin and "whitelist" plugin to my project and it worked.
I used phonegap to compile it but also did it from framework 7 using GUI bash. To do that either add the plugin one line declaration to you config.xml file (in this case I added to the one in root folder AND the config.xml in www folder) and the compiler will add the rest of the files for you.
Another way of adding them is through "cordova plugin add cordova-plugin-firebase --save" in your command line aiming for the root folder of your project.
Good luck!
EDIT: "cordova plugin add cordova-plugin-firebase --save" works for the framework 7 bash declaration I mentioned which I guess uses a more raw version of cordova and for that reason won't work if you're using phonegap.
from cordova-plugin-firebase-authentication.
So my problem is that I want to login using js, and not in the platform code. I was using this workaround. But that doesn't work on v1.0.1 anymore because verifyPhoneNumber isn't really supported as far as I can tell.
So I've resorted to using v0.13.2 because verifyPhoneNumber still works there. However this means I can't use the latest versions of @chemerisuk other plugins because of dependancy problems with cordova-support-google-services. So I'm kinda stuck at the moment.
from cordova-plugin-firebase-authentication.
@cairinmichie Have you registered the onAuthStateChanged
callback?
from cordova-plugin-firebase-authentication.
Yes, that still doesn't support my use case though? Unless I'm missing something? Correct me if I'm wrong, but there's no way to send an sms if the Android auto-verify has been used?
from cordova-plugin-firebase-authentication.
try to use this function:
function verifyPhone(phoneNumber) {
return new Promise(function(resolve, reject) {
const firebaseAuth = cordova.plugins.firebase.auth;
firebaseAuth.onAuthStateChanged(resolve);
return firebaseAuth
.verifyPhoneNumber(phoneNumber).then(function(verificationId) {
const smsCode = prompt("Enter SMS code");
return firebaseAuth
.signInWithVerificationId(verificationId, smsCode);
}).catch(reject);
});
}
like below:
verifyPhone("+1234567").then(function() {
console.log("phone was verified");
}).catch(function(err) {
console.error("verification failed", err);
});
from cordova-plugin-firebase-authentication.
there's no way to send an sms if the Android auto-verify has been used?
Yes, no way at present. But why do you need this?
from cordova-plugin-firebase-authentication.
My problem is this:
I use vuexfire extensively throughout my vuex store. Vuexfire requires that you use the firebase js library for authentication, as far as I'm aware. So I was using the signInWithVerificationId
function to login my users with the js library rather than android/ios. I'm not sure there is a way to accomplish logging in with the js library when using onAuthStateChanged
.
from cordova-plugin-firebase-authentication.
Related Issues (20)
- Add linkWithPhoneNumber
- Error: The default Firebase app has not yet been configured
- The correct version of cocoapod and your plugin for cordova-ios 5.1.1 HOT 3
- Android build app (APK) closing on Phone Auth function: verifyPhoneNumber(phone,timeout) HOT 3
- verifyPhoneNumber fails since 4.0.2 (Android) HOT 3
- verifyPhoneNumber() causes app restart
- Cannot add extension "googleServices" Already registered HOT 1
- FATAL EXCEPTION on "onAuthStateChanged"
- Does this supports firebase multi tenancy
- SignOut does not delete user's data on disk HOT 3
- How can the new Firebase App Check affect the plugin?
- getCurrentUser does not exist HOT 1
- iOS: Add user property "refreshToken" from FIRUser HOT 2
- IOS: I cant get this to work
- IOS_FIREBASE_POD_VERSION in the plugin HOT 2
- Unable to build in iOS using XCode 13.1 HOT 2
- Compatible with firebase 9?
- Cordova Plugin mapping not found in ios
- Library expects a BoM package: com.google.firebase:firebase-auth
- timeoutMillis is no longer an optional parameter
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cordova-plugin-firebase-authentication.