Skip to content

Commit 65ff31e

Browse files
committed
Update ReactNative to Pushbots iOS SDK 2.1 and android SDK 3.1 && bug fixes
1 parent 8c73be1 commit 65ff31e

File tree

22 files changed

+120
-339
lines changed

22 files changed

+120
-339
lines changed

README.md

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,37 +23,24 @@
2323

2424
#### Adding the Code
2525

26-
* in `AppDelegate.h`:
27-
Import **RCTPushbots** and Add PushbotsClient:
26+
* Open `AppDelegate.h` Import **RCTPushbots** and Add **PushbotsClient**
2827

2928
```objc
3029
#import "RCTPushbots.h"
3130
.....
3231
@property (strong, nonatomic) RCTPushbots *PushbotsClient;
3332
```
3433

35-
* in `AppDelegate.m`:
34+
* Open `AppDelegate.m`: Add PushBots code to `application:didFinishLaunchingWithOptions` method (replace APP_ID with your PushBots app ID):
3635

37-
* Synthesize PushbotsClient
38-
39-
```objc
40-
@synthesize PushbotsClient = _PushbotsClient;
41-
```
42-
43-
* On the `application didFinishLaunchingWithOptions` method, add the following code (replace APP_ID with your PushBots app ID):
44-
45-
Add this line to **didFinishLaunchingWithOptions**:
4636
```objc
4737
self.PushbotsClient = [[RCTPushbots alloc] initWithAppId:@"APP_ID"];
4838
```
4939
50-
* Voila!
51-
52-
5340
### Android
5441
55-
Go to `build.gradle` app level and add this in default config
56-
Add the following to defaultConfig in `build.gradle` file inside the android/app folder
42+
Go to `android/app/build.gradle` app level and add this in default config
43+
Add the following to **defaultConfig** in `build.gradle` file inside the android/app folder
5744
5845
```gradle
5946
defaultConfig {
@@ -65,13 +52,41 @@ defaultConfig {
6552
}
6653
```
6754

55+
Update **buildToolsVersion** and **compileSdkVersion** to 27
56+
```gradle
57+
android {
58+
compileSdkVersion 27
59+
buildToolsVersion "27.0.3"
60+
....
61+
}
62+
```
63+
64+
Update `com.android.support` to 27 in **dependencies**
65+
66+
```gradle
67+
dependencies {
68+
...
69+
compile "com.android.support:appcompat-v7:27.1.0"
70+
..
71+
}
72+
```
73+
Open `android/build.gradle`, Add google repo
74+
```gradle
75+
allprojects {
76+
repositories {
77+
...
78+
maven { url 'https://maven.google.com' }
79+
```
6880

6981
### Usage
7082

7183
in your App.js:
7284

7385

7486
```javascript
87+
import {
88+
Alert
89+
} from 'react-native';
7590

7691
import Pushbots from 'pushbots-react-native'
7792

android/._build.gradle

4 KB
Binary file not shown.

android/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ buildscript {
44
}
55

66
dependencies {
7-
classpath 'com.android.tools.build:gradle:2.1.0'
7+
classpath 'com.android.tools.build:gradle:2.2.2'
88
}
99
}
1010

1111
apply plugin: 'com.android.library'
1212

1313
android {
14-
compileSdkVersion 26
15-
buildToolsVersion "26.0.2"
14+
compileSdkVersion 27
15+
buildToolsVersion "27.0.3"
1616

1717
defaultConfig {
1818
minSdkVersion 16
@@ -31,6 +31,6 @@ repositories {
3131

3232
dependencies {
3333
compile 'com.facebook.react:react-native:+'
34-
compile 'com.google.android.gms:play-services-gcm:+'
35-
compile 'com.pushbots:pushbots-lib:3.0.3@aar'
34+
compile 'com.google.android.gms:play-services-gcm:11.8.0'
35+
compile 'com.pushbots:pushbots-lib:3.1.1-r@aar'
3636
}

android/react-native-pushb.iml

Lines changed: 0 additions & 159 deletions
This file was deleted.

ios/.DS_Store

6 KB
Binary file not shown.

ios/._.DS_Store

4 KB
Binary file not shown.

ios/._RCTPushbots.h

4 KB
Binary file not shown.

ios/._RCTPushbots.m

4 KB
Binary file not shown.

ios/Pushbots.a

-1.84 MB
Binary file not shown.

0 commit comments

Comments
 (0)