cordova-plugin-firebase-authentication icon indicating copy to clipboard operation
cordova-plugin-firebase-authentication copied to clipboard

not able to find full example code for this plugin

Open mazeethd opened this issue 6 years ago • 5 comments

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

mazeethd avatar Jul 23 '18 05:07 mazeethd

Yeah it would be great if there was some sample code to use this plugin :( @mazeethd were you able to find anything?

zabaat avatar Dec 11 '18 06:12 zabaat

If you are using cordova you shouldn't need to do anything special. It depends on what you need to do. Keep in mind all methods need to be run after the Device Ready event from cordova. In case you are using webpack or anything like that, you don't need to do any imports, but keep in mind the cordova object resides inside "window", so you need to add that before the calls, so this:

cordova.plugins.firebase.auth.signInWithEmailAndPassword("[email protected]", "pa55w0rd")

would instead be:

window.cordova.plugins.firebase.auth.signInWithEmailAndPassword("[email protected]", "pa55w0rd")

JavierPAYTEF avatar Mar 09 '19 08:03 JavierPAYTEF

Hi All, we are all the same here having trouble making this work as the docs have very minimal instructions. i was able to make it work so i will try to put it here and might help you.

note: this is for android only. i have not yet reached the staged for ios (but i think the idea would be the same). also, this is assumed you already have a project in firebase and already setup sign-in methods on firebase authentication.

step 1. create an app in the firebase project you just created. select android. step 2. while creating the app, make sure the package name is the same with your android app or else it won't work. step 3. download the config file (this will be given during creation of app in firebase) step 4. copy it in "{ionic app}/android/app".

p.s : step 3-4 were based on the given instructions during creation of an app in firebase.

i know this is kinda old but i hope this helps anyone in the future (including me) 😄

an2ny avatar May 03 '20 19:05 an2ny

I have yet to found how to configure signing in with Google on Android. The signInWithGoogle() require parameters idToken, accessToken, on which the readme redirect us to to Firebase docs page, which in turn points to Android guide on how to get the idToken and accessToken. I would hope a plugin like this already integrate that. Without which, it is simpler using the web Firebase Client. If the plugin has this functionality, how is it done?

benedictjohannes avatar May 10 '20 23:05 benedictjohannes

I have yet to found how to configure signing in with Google on Android. The signInWithGoogle() require parameters idToken, accessToken, on which the readme redirect us to to Firebase docs page, which in turn points to Android guide on how to get the idToken and accessToken. I would hope a plugin like this already integrate that. Without which, it is simpler using the web Firebase Client. If the plugin has this functionality, how is it done?

@benedictjohannes i don't think there is. and we don't know if there will be.

an2ny avatar May 13 '20 09:05 an2ny