chemerisuk / cordova-plugin-firebase-authentication

Cordova plugin for Firebase Authentication
MIT License
98 stars 60 forks source link

not able to find full example code for this plugin #41

Open mazeethd opened 6 years ago

mazeethd commented 6 years ago

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

zabaat commented 5 years ago

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

JavierPAYTEF commented 5 years ago

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("my@mail.com", "pa55w0rd")

would instead be:

window.cordova.plugins.firebase.auth.signInWithEmailAndPassword("my@mail.com", "pa55w0rd")

an2ny commented 4 years ago

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) 😄

benedictjohannes commented 4 years ago

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?

an2ny commented 4 years ago

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.