chemerisuk / cordova-plugin-firebase-authentication Goto Github PK
View Code? Open in Web Editor NEWCordova plugin for Firebase Authentication
License: MIT License
Cordova plugin for Firebase Authentication
License: MIT License
My package.json
"cordova-android": "7.1.4",
"cordova-android-support-gradle-release": "^2.0.1",
"cordova-ios": "4.4.0",
"cordova-plugin-app-event": "^1.2.1",
"cordova-plugin-camera": "^4.0.3",
"cordova-plugin-compat": "^1.2.0",
"cordova-plugin-console": "^1.1.0",
"cordova-plugin-crosswalk-webview": "^2.4.0",
"cordova-plugin-customurlscheme": "^4.3.0",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-dialogs": "^2.0.1",
"cordova-plugin-file": "^6.0.1",
"cordova-plugin-file-transfer": "^1.7.1",
"cordova-plugin-firebase-authentication": "^1.0.1",
"cordova-plugin-google-analytics": "^1.8.6",
"cordova-plugin-image-picker": "^1.1.3",
"cordova-plugin-inappbrowser": "^3.0.0",
"cordova-plugin-network-information": "^2.0.1",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-statusbar": "^2.4.2",
"cordova-plugin-velda-devicefeedback": "0.0.2",
"cordova-plugin-video-editor": "^1.1.3",
"cordova-plugin-whitelist": "^1.3.3",
"cordova-support-android-plugin": "^1.0.1",
"cordova-support-google-services": "^1.2.1",
"de.appplant.cordova.plugin.local-notification": "^0.8.5"
Cordova -v: 8.0.0
Hello,
thanks for the great plugins,
question is does this plugin supports auth login ?
or only email and phone login ?
the message is: Please verifythat the correct package name and SHA-1 are configured in the Firebase Console.
i already did...
Asking for cordova-android 7 creates several problems like a total incompatibility with Android 4, and failure to develop and deploy with Visual Studio. Creating PR to revert it to 6.3.0, it works perfectly fine with CLI 7.1.0 and on Android 4 using the polyfill for your Promise methods.
Hi,
this might be a weird question, but I need to know if there is any chance to pass
https://github.com/chemerisuk/cordova-plugin-firebase-authentication/blob/master/src/android/FirebaseAuthenticationPlugin.java#L227
"credential" back to the app? It's not a problem for me to implement a pluginResult, I already tried that, but passing back "credential" isn't any JSON object or something, its something like "com.google.firebnase...@xxxx".
Some JavaInstance or Object I guess. You might ask why I would ever need that: simple; due to Instantverifications and Auto-retrival, my app has a unhandled case (I did not use your plugin, I used a mix from other plugins) and build a credential with the JS-SDK. But this requires a "verificationId", which won't be passed back, as "onCodeSent" won't trigger if there was any instant-verification or auto-retrieval. "credential" only has getProvider() and getSmsCode() - which is useless for me, as getSmsCode can also be null.
I just want to know if you have any idea how to get a working "credential" (maybe as string) so I can just
// generate credential object with ID from last page and newly entered code
var credential = firebase.auth.PhoneAuthProvider.credential(
params.verificationId,
$scope.code
);
or REPLACE the "credential" which I have to pass for the JS-SDK. Maybe there is an internal API which still can deliver the verificationId even on instant/auto-retrieval?)
Im not a native speaker, I hope I could make myself clear enough.
Currently, my app relies on the js-sdk, I don't have any chance to change my code to 100% incorporate your awesome plugin (as I also do need to upload images and using store-functions, which requires a js-auth)
Would love to donate some $ if you can help me on this.
Can I use This plugin in my Ionic App Please Help
Currently, calling a window.location.reload() will cause the callback be registered multiple times. There is also no way to remove a listener.
I'm creating a PR to solve this issue by removing the FIREBASE_AUTH_VERSION
parameter and manually setting it to 16.0.+
as this is the only workaround I found. If someone knows how to implement it properly, he or she could create a new PR.
Output from Visual Studio (cordova 6.5.0 & cordova-android 6.3.0)
Cordova 7.1.0 with cordova-android 6.3.0 fails to build errors such as this:
1>MSBUILD : cordova-build error : D:\Cordova\FirebaseCLI710\platforms\android\src\by\chemerisuk\cordova\firebase\FirebaseAuthenticationPlugin.java:61: error: local variable callbackContext is accessed from within inner class; needs to be declared final
1> D:\Cordova\FirebaseCLI710\platforms\android\src\by\chemerisuk\cordova\firebase\FirebaseAuthenticationPlugin.java:61: error: local variable callbackContext is accessed from within inner class; needs to be declared final
[...]
I've fixed these errors by adding the final
keyword before all CallbackContext callbackContext
function's arguments, and a pull request has been created for this.
Hello,
thanks for the great plugins,
I used "signInWithVerificationId()" in my ionic Application. Every thing is working great. But i am not able to use Firebase database rules with this plugin. Below are my codes. Please help to implement database rules.
I used https://ionicframework.com/docs/v3/native/firebase-authentication/ to authenticate users
and https://www.npmjs.com/package/firebase to access firebase data.
send(){ this.firebaseAuthentication.verifyPhoneNumber(this.mobile,60).then((data)=>{ console.log(data) this.verificationId = data; alert('OTP SENT'); },error=>{ console.log(error) }) }
verify(){ this.firebaseAuthentication.signInWithVerificationId(this.verificationId, this.code).then((verified)=>{ if(verified=='OK'){ console.log('user loggedin successfully') } },error=>{ console.log(error) }) }
this.firebaseAuthentication.onAuthStateChanged().subscribe((user)=>{ if(user){ console.log(user); firebase.database().ref('dummydata').on('value',snapshot=>{ console.log('data ',snapshot.val()) },error=>{ console.log('error ',error) }) }
{ "rules": { "dummydata":{ ".read": "auth!=null", ".write": "auth!=null" } } }
When call verifyPhoneNumber from javascript, if phone is auto verified no sms is sent, on native side it seems onVerificationCompleted is called but no callback is passed to javascript side. How to handle this situation?
it is very tough to use this plugin as there is no full example code on using this pluging like
what name needs to be imported and how to invoke the plugin api from js file etc
Hi,
First of all, thanks for this plugin. I have implemented this plugin in my Ionic Project for a while.
In Android, I was facing an issue that I occasionally get a message "The SMS code has expired" after I have entered SMS OTPcode and hit verify button. At that time I have already the verification code and everything else to proceed. It turns out the plugin has skipped one callback to handle incoming SMS auto verification. Please check this Auto-retrieval
If SMS auto retrieval is implemented, it will trigger action in onVerificationCompleted automatically. So when SMS arrives and user try to enter SMS OTP code to proceed with cordova.plugins.firebase.auth.signInWithVerificationId, at that time the error message will be shown that SMS code has expired. In fact verification has already been done when SMS has arrived.
Therefore I modified the source code (android) to handle this situation. I added a new function waitForSMSVerificationResult to register the callback to onVerificationCompleted. General code will be as below.
// after user wants to get OTP code
cordova.plugins.firebase.auth.waitForSMSVerificationResult(function(userInfo){
// get user info after sign in successfully
console.log(userInfo)
// perform action after user sign in
});
cordova.plugins.firebase.auth.verifyPhoneNumber(phone, 0, function(verificationId) {
if(verificationId) {
// store verification somewhere else
}
});
// after user enters SMS OTP code
cordova.plugins.firebase.auth.signInWithVerificationId(verificationId, SMScode);
Above is just temporary modification, hope you can restructure the code for handling SMS auto-retrieval situation.
For IOS I didn't get any trouble on this. It always prompts user to enter SMS OTP code to proceed with phone verification, no instant or SMS autoretrieval verification.
Again thanks for this plugin.
I've followed the instructions from https://firebase.google.com/docs/auth/web/cordova and I'm having the next issue:
After the this.afAuth.auth.signInWithRedirect(provider) the app redirect to google chrome to the firebase service from google. Then the service return back to a http://localhost:8080/login which is denied by my app with a ERR_CONNECTION_REFUSED.
This is my angular component:
`import { Component, OnInit } from '@angular/core';
import { AngularFireAuth } from '@angular/fire/auth';
import { auth } from 'firebase/app';
@component({
selector: 'app-login',
templateUrl: './login.page.html',
styleUrls: ['./login.page.scss'],
})
export class LoginPage implements OnInit {
username: string ="";
password: string ="";
kk: string = "";
constructor(public afAuth: AngularFireAuth) { }
ngOnInit() {
this.kk = "hola";
}
async login() {
const {username, password} = this;
try {
const res = await this.afAuth.auth.signInWithEmailAndPassword(username + '@codedamn.com', password)
} catch(err) {
console.dir(err)
if (err.code === "auth/user-not-found") {
console.log("User not found");
}
}
}
async login2() {
var provider = new auth.GoogleAuthProvider();
await this.afAuth.auth.signInWithRedirect(provider).then(function() {
return this.afAuth.auth.auth().getRedirectResult();
}).then(function(result) {
// This gives you a Google Access Token.
// You can use it to access the Google API.
var token = result.credential.accessToken;
// The signed-in user info.
var user = result.user;
// ...
}).catch(function(error) {
// Handle Errors here.
var errorCode = error.code;
var errorMessage = error.message;
});
}
}`
How to import in ionic3's app.module.ts ?
Thank's a lot
Can I get the user ID, Name Profile info etc
Hello,
Getting iOS compile error after installing the plugin
FIRBundleUtil.m:17:9: fatal error:
'GoogleUtilities/GULAppEnvironmentUtil.h' file not found
#import <GoogleUtilities/GULAppEnvironmentUtil.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error:
The default FIRApp instance must be configured before the default FIRAuthinstance can be initialized. One way to ensure that is to call [FIRApp configure];
(`FirebaseApp.configure()
How to do that?
Hi,
In firebase console, the template is %LOGIN_CODE% is your verification code for %APP_NAME%.
After I use the plugin in my android application, the sms received became
"123456 is your verification code for Payments".
I have checked multiple times that I did not include any definitions/naming as Payments in my app.
Is this something defined in the plugin itself? If yes, may I be able to change it somewhere?
Btw, although it seems to be working fine to call verifyPhoneNumber again for resending sms, there are something like force Resending Token in the official doc and another overload method to take it for resending. Hope to have the function in the future :) Thanks so much :)
Hi , when I use cordova.plugins.firebase.auth.getIdToken().then(function(id){}) method "Uncaught (in promise) JSON error" this error returned.
how can I resolve it?
Hi there,
It seems like perhaps there may be an incompatibility between cordova-plugin-firebase-auth and cordova-plugin-firebase. When running either of these two plugins independently, there is no issue in compile, but when these two are used in conjunction, I always seem to get the following errors:
/Users/jcrombie/Application_Building/SellMeToys/platforms/ios/SellMeToys/Plugins/cordova-plugin-firebase-authentication/FirebaseAuthenticationPlugin.m:41:41: Incompatible block pointer types sending 'void (^)(FIRAuthDataResult *__strong, NSError *__strong)' to parameter of type 'FIRAuthResultCallback _Nullable' (aka 'void (^)(FIRUser * _Nullable __strong, NSError * _Nullable __strong)')
/Users/jcrombie/Application_Building/SellMeToys/platforms/ios/SellMeToys/Plugins/cordova-plugin-firebase-authentication/FirebaseAuthenticationPlugin.m:88:37: Incompatible block pointer types sending 'void (^)(FIRAuthDataResult *__strong, NSError *__strong)' to parameter of type 'FIRAuthResultCallback _Nullable' (aka 'void (^)(FIRUser * _Nullable __strong, NSError * _Nullable __strong)')
/Users/jcrombie/Application_Building/SellMeToys/platforms/ios/SellMeToys/Plugins/cordova-plugin-firebase-authentication/FirebaseAuthenticationPlugin.m:95:53: Incompatible block pointer types sending 'void (^)(FIRAuthDataResult *__strong, NSError *__strong)' to parameter of type 'FIRAuthResultCallback _Nullable' (aka 'void (^)(FIRUser * _Nullable __strong, NSError * _Nullable __strong)')
Plugin List:
macbook34:ios$ cordova plugins
cordova-plugin-browsertab 0.2.0 "cordova-plugin-browsertab"
cordova-plugin-buildinfo 2.0.1 "BuildInfo"
cordova-plugin-compat 1.2.0 "Compat"
cordova-plugin-customurlscheme 4.3.0 "Custom URL scheme"
cordova-plugin-firebase 1.0.5 "Google Firebase Plugin"
cordova-plugin-firebase-authentication 1.0.1 "cordova-plugin-firebase-authentication"
cordova-plugin-firebase-dynamiclinks 1.0.0 "FirebaseDynamicLinksPlugin"
cordova-plugin-inappbrowser 3.0.0 "InAppBrowser"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova-universal-links-plugin 1.2.1 "Universal Links Plugin"
I have tried adding one first, then the other (both ways)...clean/cleanBuildFolder, and clearing derived data...
Each works splendidly on their own, but together...not so much (at least for me)
Here is the pods in use here
macbook34:ios jcrombie$ cat Podfile.lock
PODS:
DEPENDENCIES:
SPEC REPOS:
https://github.com/cocoapods/specs.git:
- Firebase
- FirebaseAnalytics
- FirebaseAuth
- FirebaseCore
- FirebaseInstanceID
- GoogleToolboxForMac
- GTMSessionFetcher
- nanopb
SPEC CHECKSUMS:
Firebase: d66f4f29c23f22d96808d9abc174d81d8eee968f
FirebaseAnalytics: b3628aea54c50464c32c393fb2ea032566e7ecc2
FirebaseAuth: 096e457cdd4274412a66c4a35874787e411f5a03
FirebaseCore: 42b3267233bd21a5abd54117ccc38ca3dd0f8e83
FirebaseInstanceID: f3f0657372592ecdfdfe2cac604a5a75758376a6
GoogleToolboxForMac: 91c824d21e85b31c2aae9bb011c5027c9b4e738f
GTMSessionFetcher: 5fa5b80fd20e439ef5f545fb2cb3ca6c6714caa2
nanopb: 5601e6bca2dbf1ed831b519092ec110f66982ca3
PODFILE CHECKSUM: 98899dd330043c312eb531d66cfc5c9813310161
COCOAPODS: 1.5.3
I noted that some flutter users were also having this issue here:
However, the prescribed fix of just running a pod repo update didnt seem to work....
If you have any suggestions?
I've followed the advice from this related issue without success to solve this error:
The following build commands failed:
CompileC /Users/andres/Library/Developer/Xcode/DerivedData/myapp-fzzedyqaehwzihfmlblyztcnfzqu/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FirebaseCore.build/Objects-normal/x86_64/FIRNetwork.o FirebaseCore/Firebase/Core/FIRNetwork.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/andres/Documents/cordova/myapp/platforms/ios/cordova/build-debug.xcconfig,-workspace,myapp.xcworkspace,-scheme,myapp,-configuration,Debug,-sdk,iphonesimulator,-destination,platform=iOS Simulator,name=iPhone X,build,CONFIGURATION_BUILD_DIR=/Users/andres/Documents/cordova/myapp/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/andres/Documents/cordova/myapp/platforms/ios/build/sharedpch
Steps to reproduce please tell me if I missed something
.xcworkspace
in Xcode to:
<resource-file src="GoogleService-Info.plist" />
to config.xmlpod update
and pod install
in the platforms/ios
foldercordova build ios
will now inevitably failThe app can be built and deployed from Xcode only (making it impossible to use cordova now), and the plugin does work, with these warnings:
2018-06-23 20:48:51.901313-0300 myapp[1131:651997] Starting Firebase Authentication plugin
2018-06-23 20:48:51.906258-0300 myapp[1131:652210] 5.3.0 - [Firebase/Core][I-COR000003] The default Firebase app has not yet been configured. Add `[FIRApp configure];` (`FirebaseApp.configure()` in Swift) to your application initialization. Read more: https://goo.gl/ctyzm8.
2018-06-23 20:48:51.918088-0300 myapp[1131:652210] 5.3.0 - [Firebase/Core][I-COR000022] Firebase Analytics is not available
How can we fix the cordova build ios
error 65 now?
Why does the plugin require firebase analytics?
Wasn't the initialization error fixed here?
I am getting an error sending the verificationId and SMSCode:
by.chemerisuk.cordova.firebase.FirebaseAuthenticationPlugin.signInWithVerificationId argument 2 has type java.lang.String, got java.lang.Integer
this.firebaseAuthentication.signInWithVerificationId(this.verificationId, Number(code)) expects a number in the code parameter, but actually expects a string parameter.
Package json:
"cordova-plugin-firebase": "2.0.5",
"cordova-plugin-firebase-authentication": "1.0.1",
Cordova plugins:
"cordova-plugin-firebase": {},
"cordova-plugin-firebase-authentication": {
"FIREBASE_AUTH_VERSION": "16.1.0"
}
Hello,
Getting error installing the plugin...
Please let me know how to resolve
Thanks
cordova plugin add cordova-plugin-firebase-authentication --save
Installing "cordova-plugin-firebase-authentication" for android
Plugin dependency "[email protected]" already fetched, using that version.
Installing "cordova-support-android-plugin" for android
Android Studio project detected
Plugin dependency "[email protected]" already fetched, using that version.
Installing "cordova-support-google-services" for android
Subproject Path: CordovaLib
Subproject Path: app
Subproject Path: CordovaLib
Subproject Path: app
Installing "cordova-plugin-firebase-authentication" for browser
Installing "cordova-plugin-firebase-authentication" for ios
Failed to install 'cordova-plugin-firebase-authentication': Error: pod: Command failed with exit code 31
at ChildProcess.whenDone (/Users/Documents/testing/fb/MobileV2/platforms/ios/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:877:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
pod: Command failed with exit code 31
Hello,
I am trying to sign in with SMS on my project. My code with comments is following.
`function SendSMS(){
var phoneNumber=String(document.getElementById("inputPhoneNumber").value);
cordova.plugins.firebase.auth.verifyPhoneNumber(phoneNumber).then(function(verificationId) {
SMS_code = prompt("Please enter the code: ", ""); //this async function waits until user gives an input
alert("SMS_code: "+SMS_code+"\n verificationId: "+verificationId); // I can see both code and verification ID
cordova.plugins.firebase.auth.signInWithVerificationId(verificationId, SMS_code).then(
user => {
alert("user: "+user+"\n user.uid: "+user.uid); // user: [object Object] and user.uid: xyz... this line also works fine!
NameListRef="CompleteNameList";
firebase.database().ref(NameListRef).once('value').then( function(snapshot){
NameList=snapshot.val();
alert("NameList: " +NameList);
},
function(error){
alert("error: " +error); //Error: permission_denied. client does not have permission to access the desired data.
});
}, error=>{
alert("error: "+error);
});
});
}`
The only rule for my database is authentication. After this point, I have checked whether I am signed in. I have added a listener and a function (fired by a button).
`cordova.plugins.firebase.auth.onAuthStateChanged(function(userInfo) {
if (userInfo && userInfo.uid) {
alert("user signed in"); // THIS ALERT NEVER FIRES
} else {
alert("user signed out");
}
});
function checkUser(){ // called by button
currentUserUID= firebase.auth().user;
alert("currentUserUID: " +currentUserUID); //UNDEFINED
}`
PS: I have added the correct package name and SHA-1 in the Firebase Console
PS2: I can see that new user is created at Firebase console and "last sign in time" is updated.
Thanks...
Hi @chemerisuk, i tried to install cordova-plugin-firebase-authentication
but got this error:
Installing "cordova-plugin-firebase-authentication" for ios
Failed to install 'cordova-plugin-firebase-authentication': Error
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:581:33
at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13)
at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:509:49
at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17)
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
Error: Version of installed plugin: "[email protected]" does not satisfy dependency
plugin requirement "cordova-plugin-firebase-analytics@~0.10.0". Try --force to use installed plugin as
dependency.
The cordova plugin was aded without errors (cocoapods was installed and setup during the process). However the following errors occur when trying to build an app:
Android:
Could not get unknown property 'FIREBASE_VERSION' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
iOS:
ld: warning: directory not found for option ‘-L/Users/…/Debug-iphoneos/GTMSessionFetcher’
ld: warning: directory not found for option ‘-L/Users/…/Debug-iphoneos/GoogleToolboxForMac’
ld: warning: directory not found for option ‘-L/Users/…/Debug-iphoneos/nanopb’
ld: library not found for -lGTMSessionFetcher
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Hi @chemerisuk
thanks for this plugin. Does this plugin implement the native phone-sign-in UI? Or do we have to handle this ourselves? Thanks in advance!
"@ionic-native/firebase": "^4.9.0",
"cordova-plugin-firebase": "^1.0.5",
"cordova-plugin-firebase-authentication": "^1.0.1",
"firebase": "^5.2.0",
Above are the related package installed. Not sure is it conflicted with other libraries.
Thanks.
I have a project in production that uses this method and I updated my dependancies and this broke. Any idea why it broke?
I've used phone authentication . when I use auth state fun provided by firebase sdk , it doesn't observe
any change to users state . How could I solve this ?
Hello Sir,
onAuthStateChanged not work on ios??
Best Regards
Hi.
Im already login and have my firebase uid, when try tu use firestore (firebase-firestore.js) i cant, because dont detect my uid... are you know some way to solve?
when i use:
cordova.plugins.firebase.auth.onAuthStateChanged bring me back the user info.
but when i use:
firebase.auth().onAuthStateChanged the result is null.
if in firesotre modify the rule to allow all, work fine, but when i just allow when are loged in... dont work.
the rule:
allow read, write: if request.auth.uid != null;
Hi there,
When I called cordova.plugins.firebase.auth.verifyPhoneNumber("+91**********", 60000, function (verificationId) {}
and passed verificationId(received from above code) and verificationCode(received through sms) to
cordova.plugins.firebase.auth.signInWithVerificationId(verificationId, verificationCode, function (userInfo) {},
function (error) {alert(error);});
but I always received "The sms code has expired. Please re-send the verification code to try again."
So please let me know how could I do it.
Hi @chemerisuk
looks like you're the first one who really implemented the native way of authentication. Sadly, this repo lacks of all the other firebase features - probably for a reason. But would you consider to add your awesome verification stuff to https://github.com/arnesson/cordova-plugin-firebase ?
This would be something awesome, as the other menitoned repo has a very hacky workaround for the verification process (and it only supports the phone-verification in combination with the js api and it also does not cover instant-verification).
Im not sure if I should mix both libs.. feels dirty and might lead into issues with firebase versions..
Hello,
Is there any plan to include email link authentication methods in that plugins ?
Thanks a lot for your work on this plugin.
trying to implement the plugin for google sign in. Your text refers to the Firebase docs but they dont seem to refer to such tokens. The reference to android doc only mentions a server token and the reference to iOS doc mention other things (twitter stuff). Can you please provide more specific instructions for the tokens needed for Google sign in?
Thanks!
Z.
Hi All i did try using plugin but when i try call verifyPhoneNumber i have issues like above
signIn() {
this.firebaseAuthentication.verifyPhoneNumber("+123123", 30000).then((verificationId) => {
console.log(verificationId);
});
}
getProviderId() always return Constant Value: "firebase"
getProviders().get(0) will return "password","facebook.com", etc
Hello @chemerisuk,
Do verifyPhoneNumber
and signInWithVerificationId
work?
Do you plan to add this plugin into the ionic-native list?
The plugin does not work at all on Android 4.x because it relies on the new ES6 promise model:
Please be aware that even when Google or Apache Cordova deprecates Android 4.x and 5.x there are still millions of devices out there using them, and there will be for a long time, specially in developing countries.
I think that plugins should stay as backwards compatible as possible, instead of relying on new methods, which should be used only when there is absolutely no alternative. Callbacks may take longer to develop but they just work.
Promises are completely unnecessary in this plugin and should be avoided like the plague if you want to develop an useful, reliable and popular plugin, otherwise why bother uploading it? The same goes for the CLI 7.1.0 requirement just because Gradle does not understand the FIREBASE_AUTH_VERSION
parameter, another irrelevant feature that breaks the plugin.
If you agree, I'll create a PR to get rid of all promises and implement regular callbacks, otherwise I'll start my own Android 4 compatible branch, damaging the plugins ecosystem which is already quite messed up. Regards,
Andres.-
I am looking for a function that will register the user with email and password. Is there a possible way to do that with java and implement it into this plugin! And can you make a tutorial on how to make the plugin work? How do we set it up?
Found firebase-auth:11.6.+, but version 11.8.0 is needed for the google-services plugin.
What can i do?
I do install the plugin but its not being imported and accesible from te javascript interface. IS it a posible conflict with the cordova-plugin-firebase I aslo have installed?
How to use the methods, for example verifyPhoneNumber
cordova.plugins.firebase.auth.verifyPhoneNumber("+123456789").then(function(verificationId) { // pass verificationId to signInWithVerificationId });
Here I get the error Cannot find name 'cordova'.
So I used this as
firebase.auth.verifyPhoneNumber("+123456789").then(function(verificationId) { // pass verificationId to signInWithVerificationId });
added import as import * as firebase from 'firebase';.
But I am getting the error :
property verifyPhoneNumber does not exist on type 'typeof auth'.
I am very new to ionic, What am I doing wrong here.
Hi @chemerisuk, do you plan to support social authentication? Google, FB...
hi,
i have a cordova project in JS.
I can read userinfo properties but not user properties. I need lock authentication if email is not verified: how can i do?
Thanks.
Hi,
On Ionic I cannot use the native firebase plugin because it needs a reCAPTACHA and on Ionic's apps this method cannot work.
Great exemple of the issue here : https://javebratt.com/firebase-phone-authentication/
Thanks
Achille
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.