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
Copy file name to clipboardExpand all lines: src/connections/destinations/catalog/moengage/index.md
+44-49Lines changed: 44 additions & 49 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -128,7 +128,7 @@ Push Notifications are a great way to keep your users engaged and informed about
128
128
129
129
**SegmentPushImplementation:**
130
130
131
-
1. Follow the directions to register for push notifications [usingSegment's SDK](/docs/connections/sources/catalog/libraries/mobile/ios/#how-do-i-use-push-notifications)..
131
+
1. Follow the directions to register for push notifications [usingSegmentSDK](/docs/connections/sources/catalog/libraries/mobile/ios/#how-do-i-use-push-notifications).
132
132
133
133
2. In your application’s application:didReceiveRemoteNotification: method, add the following:
134
134
```objc
@@ -166,7 +166,7 @@ For more info on using **Segment for iOS** refer to [**Developer Docs**](/docs/c
166
166
167
167
To use MoEngagein an Android app, you must perform the following steps to set up your environment.
To enable the full functionality of MoEngage (like PushNotifications, InAppMessaging), complete the following steps in your Android app.
172
172
@@ -211,7 +211,9 @@ Analytics analytics = new Analytics.Builder(this, "write_key")
211
211
212
212
### Initialise the MoEngage SDK
213
213
214
-
Get APP ID from the [Settings Page](http://app.moengage.com/v3/#/settings/0/0) on the MoEngage dashboard and initialise the MoEngage SDK in the `Application` class's `onCreate()`
214
+
GetAPPID from the SettingsPage`Dashboard --> Settings --> App --> General`and initialise the MoEngageSDKin the onCreate method of the `Application`class
215
+
216
+
**Note:**It is recommended that you initialise the SDK on the main thread inside `onCreate()`andnot create a worker thread and initialise the SDK on that thread.
215
217
216
218
```java
217
219
// this is the instance of the application class and "XXXXXXXXXXX" is the APP ID from the dashboard.
Copy the ServerKey from the FCM console and add it to the MoEngageDashboard(Not sure where to find the ServerKey refer to [GettingFCMServerKey](https://docs.moengage.com/docs/getting-fcmgcm-server-key). To upload it, go to [SettingsPage](https://app.moengage.com/v3/#/settings/push/mobile) and add the Server Key and package name.
243
+
Copy the ServerKey from the FCM console and add it to the MoEngageDashboard(Not sure where to find the ServerKey refer to [GettingFCMServerKey](https://docs.moengage.com/docs/getting-fcmgcm-server-key). To upload it, go to the SettingsPage`Dashboard --> Settings --> Channel --> Push --> Mobile Push --> Android`and add the ServerKeyand package name.
243
244
**Please make sure you add the keys both inTestandLive environment.**
244
245
245
246
#### Add meta information for push notification
246
247
247
-
Add the AppId, and the small and large notification icons to the builder:
248
+
To show push notifications some metadata regarding the notification is required where the small icon and large icon drawables being the mandatory ones.
249
+
Refer to the [NotificationConfig](https://moengage.github.io/android-api-reference/core/core/com.moengage.core.config/-notification-config/index.html) API reference for all the possible options.
250
+
251
+
Use the `configureNotificationMetaData()` to pass on the configuration to the SDK.
For showing Push notifications there are 2 important steps:
260
266
261
267
1. RegistrationforPush, for example generating push token.
262
268
2. Receiving the Push payload from FirebaseCloudMessaging(FCM) service and showing the notification on the device.
263
269
270
+
##### Push Registration and Receiving handled by App
264
271
265
-
#### Opt out of MoEngage Registration
272
+
###### How to opt-out of MoEngage Registration?
266
273
267
-
> note ""
268
-
>By default, the MoEngageSDK attempts to register a push token, since your application is handling the push, be sure to opt-out of the SDK's token registration.
269
-
270
-
To opt-out of MoEngage's token registration mechanism call in the `optOutTokenRegistration()` on the `MoEngage.Builder` as shown below
274
+
To opt-out of MoEngage token registration mechanism disable token registration while configuring FCMin the `MoEngage.Builder` as shown below
271
275
272
276
```java
273
277
MoEngage moEngage = new MoEngage.Builder(this, "XXXXXXXXXX")
TheApplication would need to pass the PushToken received from FCM to the MoEngageSDKfor the MoEngage platform to send out push notifications to the device.
284
288
Use the below API to pass the push token to the MoEngageSDK.
>*Note:*Be sure to pass the token to the MoEngageSDK whenever you refresh the push token, and on every application update. Passing the token on application update is important for migration to the MoEngagePlatform.
291
293
292
-
#### Pass the Push payload to the MoEngage SDK
294
+
Please make sure token is passed to MoEngageSDK whenever push token is refreshed and on application update. Passing token on application update is important for migration to the MoEngagePlatform.
295
+
296
+
###### Passing the Push payload to the MoEngage SDK
297
+
293
298
To pass the push payload to the MoEngageSDK call the MoEngageAPI from the `onMessageReceived()` from the Firebase receiver.
294
299
Before passing the payload to the MoEngageSDK you should check if the payload is from the MoEngage platform using the helper API provided by the SDK.
295
300
@@ -301,7 +306,8 @@ if (MoEPushHelper.getInstance().isFromMoEngagePlatform(remoteMessage.getData()))
301
306
}
302
307
```
303
308
304
-
#### Push Registration and Receiving handled by SDK
309
+
##### Push Registration and Receiving handled by SDK
310
+
305
311
Add the below code in your manifest file.
306
312
307
313
```xml
@@ -311,30 +317,15 @@ Add the below code in your manifest file.
311
317
</intent-filter>
312
318
</service>
313
319
```
314
-
When the MoEngageSDK handles push registration, it optionally provides a callback to the application whenever a new token is registered or the token is refreshed.
315
-
Application can get this callback by implementing `FirebaseEventListener`and registering for a callback in the Applicationclass' `onCreate()` using `MoEFireBaseHelper.Companion.getInstance().setEventListener()`
316
320
321
+
WhenMoEngageSDK handles push registration it optionally provides a callback to the Application whenever a new token is registered or the token is refreshed.
322
+
An application can get this callback by implementing `FirebaseEventListener`and registering for a callback in the Applicationclass`onCreate()`using`MoEFireBaseHelper.getInstance().addEventListener()`
323
+
Refer to the [API reference](https://moengage.github.io/android-api-reference/moe-push-firebase/moe-push-firebase/com.moengage.firebase.listener/-firebase-event-listener/index.html) for more details on the listener.
317
324
318
-
#### Configure Geo-fence
319
325
320
-
By default, the MoEngage SDK does not track location, and geo-fence campaigns do not work. To track location and run geo-fence campaigns you need to opt-in for location services in the MoEngage initializer. To initialize, call the opt-in API below:
> **Note:** To ensure that Geo-fence pushes work properly, configure your location to have location permissions enabled, and include the Play Services Location Library.
333
-
334
-
For more information about configuring the Geo-fence, see the [Configuring Geo-Fence](https://docs.moengage.com/docs/push-configuration#section-geofence-push) section in the MoEngage documentation.
335
-
336
-
####
337
-
Declaring & configuring Rich Landing Activity:
338
329
Add the following snippet and replace `[PARENT_ACTIVITY_NAME]` with the name of the parent
339
330
activity; `[ACTIVITY_NAME]` with the activity name which should be the parent of the RichLandingPage
340
331
@@ -348,17 +339,21 @@ Add the following snippet and replace `[PARENT_ACTIVITY_NAME]` with the name of
348
339
349
340
You are now all set up to receive push notifications from MoEngage. For more information on features provided inMoEngageAndroidSDK refer to the following links:
0 commit comments