Skip to content

Commit d7ef632

Browse files
committed
Merge branch 'master' of github.com:fullstackreact/react-native-firestack into feature/cocoapods
* 'master' of github.com:fullstackreact/react-native-firestack: Fix startAt, endAt, equalTo optional 2nd params on Android Update README.md Update README.md Some quick build fixes for ios10 # Conflicts: # ios/Firestack.xcodeproj/project.pbxproj # ios/Firestack/FirestackCloudMessaging.m
2 parents a804228 + da0a9f8 commit d7ef632

File tree

3 files changed

+9
-38
lines changed

3 files changed

+9
-38
lines changed

README.md

+2-35
Original file line numberDiff line numberDiff line change
@@ -306,40 +306,7 @@ We can use an external authentication provider, such as twitter/facebook for aut
306306
307307
### OAuth setup with library
308308

309-
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.
310-
311-
> 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.
312-
313-
Following the instructions on the [react-native-oauth README](https://github.com/fullstackreact/react-native-oauth), we'll need to install it using `npm`:
314-
315-
```javascript
316-
npm install --save react-native-oauth
317-
```
318-
319-
It's important to set up the authentication library fully with our app configuration. Make sure to configure your app [along with this step](https://github.com/fullstackreact/react-native-oauth#handle-deep-linking-loading) otherwise authentication _cannot_ work.
320-
321-
Once the app is configured with the instructions, we can call the `oauthManager`'s (or other library's) login method. We'll need to hold on to the `oauthToken` and an `oauthTokenSecret` provided by the provider. Using these values, we can call the `signInWithProvider()` method. The `signInWithProvider()` method accepts three parameters:
322-
323-
1. The provider (such as `twitter`, `facebook`, etc) name
324-
2. The `authToken` value granted by the provider
325-
3. The `authTokenSecret` value granted by the provider
326-
327-
```javascript
328-
// For instance, using the react-native-oauth library, this process
329-
// looks like:
330-
331-
const appUrl = 'app-uri://oauth-callback/twitter'
332-
authManager.authorizeWithCallbackURL('twitter', appUrl)
333-
.then(creds => {
334-
return firestack.signInWithProvider('twitter', creds.oauth_token, creds.oauth_token_secret)
335-
.then(() => {
336-
// We're now signed in through Firebase
337-
})
338-
.catch(err => {
339-
// There was an error
340-
})
341-
})
342-
```
309+
[Currently undergoing updates]
343310

344311
### socialLogin with custom Library
345312
If you don't want to use [react-native-oauth](https://github.com/fullstackreact/react-native-oauth), you can use other library such as [react-native-facebook-login](https://github.com/magus/react-native-facebook-login).
@@ -465,7 +432,7 @@ Wouldn't it be nice to send analytics about your app usage from your users? Well
465432
#### logEventWithName()
466433

467434
```javascript
468-
firestack.logEventWithName("launch", {
435+
firestack.analytics.logEventWithName("launch", {
469436
'screen': 'Main screen'
470437
})
471438
.then(res => console.log('Sent event named launch'))

android/src/main/java/io/fullstack/firestack/FirestackDatabase.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -641,23 +641,23 @@ private Query getDatabaseQueryAtPathAndModifiers(
641641
query = query.limitToFirst(limit);
642642
} else if (methStr.contains("equalTo")) {
643643
String value = strArr[1];
644-
String key = strArr[2];
644+
String key = strArr.length >= 3 ? strArr[2] : null;
645645
if (key == null) {
646646
query = query.equalTo(value);
647647
} else {
648648
query = query.equalTo(value, key);
649649
}
650650
} else if (methStr.contains("endAt")) {
651651
String value = strArr[1];
652-
String key = strArr[2];
652+
String key = strArr.length >= 3 ? strArr[2] : null;
653653
if (key == null) {
654654
query = query.endAt(value);
655655
} else {
656656
query = query.endAt(value, key);
657657
}
658658
} else if (methStr.contains("startAt")) {
659659
String value = strArr[1];
660-
String key = strArr[2];
660+
String key = strArr.length >= 3 ? strArr[2] : null;
661661
if (key == null) {
662662
query = query.startAt(value);
663663
} else {

ios/Firestack/FirestackCloudMessaging.m

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88

99
#import <Foundation/Foundation.h>
1010
#import <NotificationCenter/NotificationCenter.h>
11+
#if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
12+
#import <UserNotifications/UserNotifications.h>
13+
#endif
14+
#import "FirestackCloudMessaging.h"
1115
#import "FirestackEvents.h"
1216
#import "RCTConvert.h"
1317
#import "FirestackCloudMessaging.h"

0 commit comments

Comments
 (0)