diff --git a/android/src/main/java/io/fullstack/firestack/Utils.java b/android/src/main/java/io/fullstack/firestack/Utils.java index a763204..b5ab91f 100644 --- a/android/src/main/java/io/fullstack/firestack/Utils.java +++ b/android/src/main/java/io/fullstack/firestack/Utils.java @@ -105,7 +105,7 @@ public static WritableMap dataSnapshotToMap( WritableMap eventMap = Arguments.createMap(); eventMap.putString("eventName", name); eventMap.putMap("snapshot", data); - eventMap.putString("path", path); + eventMap.putString("handlePath", path); eventMap.putString("modifiersString", modifiersString); return eventMap; } diff --git a/android/src/main/java/io/fullstack/firestack/auth/FirestackAuth.java b/android/src/main/java/io/fullstack/firestack/auth/FirestackAuth.java index 3f194ba..c485230 100644 --- a/android/src/main/java/io/fullstack/firestack/auth/FirestackAuth.java +++ b/android/src/main/java/io/fullstack/firestack/auth/FirestackAuth.java @@ -159,9 +159,9 @@ public void onComplete(@NonNull Task task) { @ReactMethod public void signInWithProvider(final String provider, final String authToken, final String authSecret, final Callback callback) { - if (provider.equals("facebook")) { + if (provider.equals("facebook.com")) { this.facebookLogin(authToken, callback); - } else if (provider.equals("google")) { + } else if (provider.equals("google.com")) { this.googleLogin(authToken, callback); } else // TODO diff --git a/docs/api/authentication.md b/docs/api/authentication.md index 84cb5bb..220f7e3 100644 --- a/docs/api/authentication.md +++ b/docs/api/authentication.md @@ -100,9 +100,9 @@ Sign in the user with a 3rd party credential provider. `credential` requires the ```javascript const credential = { - provider: 'facebook', - token: '12345', - secret: '6789', + provider: 'facebook.com', + accessToken: '12345', + //secret: '6789', //'secret' does not apply to facebook authentication }; firestack.auth().signInWithCredential(credential) diff --git a/lib/modules/auth/index.js b/lib/modules/auth/index.js index 61ef65e..c44257f 100644 --- a/lib/modules/auth/index.js +++ b/lib/modules/auth/index.js @@ -1,5 +1,5 @@ // @flow -import { NativeModules, NativeEventEmitter } from 'react-native'; +import { NativeModules, NativeEventEmitter, Platform } from 'react-native'; import User from './../user'; import { Base } from './../base'; @@ -151,7 +151,11 @@ export default class Auth extends Base { * @return {Promise} A promise resolved upon completion */ signInWithCredential(credential: any): Promise { - return promisify('signInWithProvider', FirestackAuth)(credential); + if (Platform.OS === 'ios'){ + return promisify('signInWithProvider', FirestackAuth)(credential); + }else{ //Android + return promisify('signInWithProvider', FirestackAuth)(credential.provider, credential.accessToken, credential.secret); + } } /**