react-native-firestack icon indicating copy to clipboard operation
react-native-firestack copied to clipboard

signInWithProvider argument mismatch

Open ThaNarie opened this issue 8 years ago • 1 comments

I'm getting an argument mismatch on the signInWithProvider function, expected 4, received 2. I'm using the v3 branch.

The Java code expects 4 arguments (3 + callback/promise). https://github.com/fullstackreact/react-native-firestack/blob/8db8b5040b90e990816ede8b749e24ca9a486a11/android/src/main/java/io/fullstack/firestack/auth/FirestackAuth.java#L161

But the JS code sends an object as first argument. https://github.com/fullstackreact/react-native-firestack/blob/8db8b5040b90e990816ede8b749e24ca9a486a11/lib/modules/auth/index.js#L154

The link function seems to be correctly updated: https://github.com/fullstackreact/react-native-firestack/blob/8db8b5040b90e990816ede8b749e24ca9a486a11/lib/modules/auth/index.js#L137

Changing the code to this seems to work:

signInWithCredential(credential: any): Promise<Object> {
  return promisify('signInWithProvider', FirestackAuth)(credential.provider, credential.token, credential.secret);
}

ThaNarie avatar Feb 06 '17 13:02 ThaNarie

@ThaNarie This fixed it for me too, thanks. It should be accessToken in the JavaScript and in the Java as that's what it is in iOS and Web SDK. I've included this in my pull request (with docs updated for authToken too)

abcd-ca avatar Feb 13 '17 16:02 abcd-ca