Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrections in docs, auth and database subscription bug fixes for iOS/Android #284

Open
wants to merge 7 commits into
base: v3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion android/src/main/java/io/fullstack/firestack/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ public void onComplete(@NonNull Task<AuthResult> 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
Expand Down
6 changes: 3 additions & 3 deletions docs/api/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 6 additions & 2 deletions lib/modules/auth/index.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -151,7 +151,11 @@ export default class Auth extends Base {
* @return {Promise} A promise resolved upon completion
*/
signInWithCredential(credential: any): Promise<Object> {
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);
}
}

/**
Expand Down