You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 28, 2022. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+43-37Lines changed: 43 additions & 37 deletions
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,48 @@ If you don't use CocoaPods, you can integrate Batch SDK manually.
44
44
|`>= 0.60.0`| - auto-linking is supported |
45
45
|`< 0.60.0`| - From the root folder <br/> - Run `react-native link @bam.tech/react-native-batch`|
46
46
47
-
### 4. Extra steps on Android
47
+
### 4. Configure do not disturb mode for mobile landings/in app messages
48
+
49
+
Mobile landings/in app messages are modals that open in your app after being triggered by a push notification or an event.
50
+
By default, they appear as soon as they are triggered, meaning that such a message can appear when your app is not yet ready. (JS code not loaded, or your navigation is not yet mounted, or any other logic that you implemented)
51
+
This can raise problems, for example if one of the buttons in the in app message should redirect somewhere in your app, if the navigation is not yet ready, it won't work.
52
+
Batch has a "do not disturb" mode that can delay those messages until you indicate that your app is ready.
53
+
Do not disturb mode has no impact on push notifications, only on mobile landings/in app messages.
54
+
55
+
If you have a typical React Native app (eg. no brownfield), you should enable do not disturb mode.
56
+
In the future, we might enable do not disturb mode by default, but currently we don't, in order to have the same default behavior as full native apps.
57
+
58
+
You can enable do not disturb mode with the following steps:
When your app is ready to be interacted with (for example, after showing the splashscreen or preparing your navigation), disable do not disturb and show the pending in app message or mobile landing:
@@ -127,7 +168,7 @@ public void onNewIntent(Intent intent)
127
168
}
128
169
```
129
170
130
-
### 5. Extra steps on iOS
171
+
### 6. Extra steps on iOS
131
172
132
173
#### a. Enable Push Capabilities
133
174
@@ -181,18 +222,6 @@ import { BatchPush } from '@bam.tech/react-native-batch';
181
222
BatchPush.registerForRemoteNotifications();
182
223
```
183
224
184
-
### Show pending in app message or mobile landing
185
-
186
-
When your app is ready to be interacted with (for example, after showing the splashscreen or preparing your navigation), show the pending in app message or mobile landing:
**NB:** Batch's Do Not Disturb mode is enabled by default in React Native because your JS app might not be loaded when the user interacts with it. This could lead to problems when a button should redirect inside your JS app. You can disable this behaviour (see below).
195
-
196
225
<hr>
197
226
198
227
## Other
@@ -282,29 +311,6 @@ Because of this, you have to make sure to call this method only once in the app
282
311
283
312
Make sure to also listen for the Linking `url` event in case Batch opens your deep-link after you call getInitialURL.
284
313
285
-
### Disable do not disturb
286
-
287
-
If you want to disable do not disturb (if you have a brownfield app for example):
0 commit comments