Skip to content

Commit 809bf3d

Browse files
committed
Updates to README and Firestack.m source
1 parent ffdd463 commit 809bf3d

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,15 @@ server.signInWithEmail('ari@fullstack.io', '123456')
168168

169169
#### signInWithProvider()
170170

171-
We can use an external authentication provider, such as twitter/facebook for authentication. In order to use an external provider, we need to include another library.
171+
We can use an external authentication provider, such as twitter/facebook for authentication. In order to use an external provider, we need to include another library to handle authentication.
172+
173+
> By using a separate library, we can keep our dependencies a little lower and the size of the application down.
174+
175+
We'll use the [react-native-oauth](https://github.com/fullstackreact/react-native-oauth) library, which was built along-side [Firestack](https://github.com/fullstackreact/react-native-firestack) specifically to handle authentication through third-party providers.
176+
177+
> If you prefer to use another library, make sure you pass through the `oauthToken` and `oauthTokenSecret` provided by your other library to call the `signInWithProvider()` method.
178+
179+
Following the instructions at
172180

173181
...
174182

firestack.ios.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ export default class Firestack {
7373
return promisify('signInWithProvider')(provider, authToken, authSecret);
7474
}
7575

76-
7776
reauthenticateWithCredentialForProvider(provider, token, secret) {
7877
return promisify('reauthenticateWithCredentialForProvider')(provider, token, secret);
7978
}

ios/Firestack/Firestack.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,11 @@ @implementation Firestack
5151
NSDictionary *userProps = [self userPropsFromFIRUser:user];
5252
callback(@[[NSNull null], userProps]);
5353
} else {
54+
NSLog(@"An error occurred: %@", [error localizedDescription]);
5455
// No user is signed in.
5556
NSDictionary *err = @{
56-
@"error": @"No user signed in"
57+
@"error": @"No user signed in",
58+
@"description": [error localizedDescription]
5759
};
5860
callback(@[err]);
5961
}
@@ -513,7 +515,7 @@ - (FIRAuthCredential *)getCredentialForProvider:(NSString *)provider
513515
secret:(NSString *)authTokenSecret
514516
{
515517
FIRAuthCredential *credential;
516-
if ([provider isEqual: @"twitter"]) {
518+
if ([provider isEqualToString: @"twitter"]) {
517519
credential = [FIRTwitterAuthProvider credentialWithToken:authToken
518520
secret:authTokenSecret];
519521
} else {

0 commit comments

Comments
 (0)