Skip to content
This repository was archived by the owner on Jul 28, 2022. It is now read-only.

Commit 74ac993

Browse files
committed
Remove now unnecessary Batch.start method
1 parent d8916c0 commit 74ac993

File tree

3 files changed

+5
-26
lines changed

3 files changed

+5
-26
lines changed

README.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ In `AppDelegate.m`, start Batch:
139139
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
140140
{
141141
...
142-
[RNBatch start:false]; // or true if you want the do not disturb mode
142+
[RNBatch start];
143143
...
144144
return YES;
145145
}
@@ -148,22 +148,14 @@ In `AppDelegate.m`, start Batch:
148148
#### d. Setup your UNUserNotificationCenterDelegate
149149

150150
* If you use Firebase or another framework swizzling your AppDelegate, follow the [manual integration](https://doc.batch.com/ios/advanced/manual-integration) guide
151-
* Otherwise, add `[BatchUNUserNotificationCenterDelegate registerAsDelegate];` after the `[RNBatch start:false];` call in your `AppDelegate.m`
151+
* Otherwise, add `[BatchUNUserNotificationCenterDelegate registerAsDelegate];` after the `[RNBatch start];` call in your `AppDelegate.m`
152152

153153
If you want to show foreground notifications, add the [relevant configuration](https://doc.batch.com/ios/advanced/customizing-notifications#showing-foreground-notifications-ios-10-only): `[BatchUNUserNotificationCenterDelegate sharedInstance].showForegroundNotifications = true;` after registering the delegate .
154154

155155
<hr>
156156

157157
## Usage
158158

159-
### Start Batch
160-
161-
```js
162-
import { Batch } from '@bam.tech/react-native-batch';
163-
164-
Batch.start();
165-
```
166-
167159
### Enable push notifications on iOS
168160

169161
```js
@@ -308,7 +300,7 @@ defaultConfig {
308300

309301
* On iOS, add in your `Info.plist`:
310302

311-
```plist
303+
```xml
312304
<key>BatchDisableDoNotDisturb</key>
313305
<true/>
314306
```

android/src/main/java/tech/bam/RNBatchPush/RNBatchModule.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,6 @@ public RNBatchModule(ReactApplicationContext reactContext) {
101101
this.batchInboxFetcherMap = new HashMap<>();
102102
}
103103

104-
// BASE MODULE
105-
106-
@ReactMethod
107104
public void start() {
108105
Activity activity = getCurrentActivity();
109106
if (activity == null) {
@@ -113,6 +110,8 @@ public void start() {
113110
Batch.onStart(activity);
114111
}
115112

113+
// BASE MODULE
114+
116115
@ReactMethod
117116
public void optIn() {
118117
Batch.optIn(reactContext);

src/Batch.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,6 @@ const RNBatch = NativeModules.RNBatch;
1212
* Batch React-Native Module
1313
*/
1414
export const Batch = {
15-
/**
16-
* Start Batch.
17-
*/
18-
start: (): void => {
19-
if (Platform.OS === 'ios') {
20-
// start should be made on native side in didFinishLaunchingWithOptions
21-
return;
22-
}
23-
24-
RNBatch.start();
25-
},
26-
2715
/**
2816
* Opt In to Batch SDK Usage.
2917
*

0 commit comments

Comments
 (0)