davecoates / rn-firebase-bridge

React Native Firebase Bridge
59 stars 8 forks source link

signInWithCredential on Android/iOS has different params #13

Closed victor-falcon closed 8 years ago

victor-falcon commented 8 years ago

In the readme file it says to pass the credential like these:

const credential = FacebookAuthProvider.credential(token);
signInWithCredential(credential);

But in Android FirebaseBridgeAuth.java the function it's defined as void signInWithCredential(String id, final Promise promise).

Maybe I'm wrong but I'm having problems making this works on Android. 😕

davecoates commented 8 years ago

Sorry about that - what I wrote in the docs wasn't quite correct. Everything over the bridge is async so FacebookAuthProvider.credential(token) returns a promise and signInWithCredential expected you to await the promise value and pass that through, eg.

FacebookAuthProvider.credential(token).then(signInWithCredential)

I've updated it so you can do either now - if you pass through the promise it will now work.

Let me know if that works for you now

victor-falcon commented 8 years ago

Now it's working. I don't know it's the problem was with this package or with the Google Play Services version of my emulator device.

Thanks!