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
+66-72Lines changed: 66 additions & 72 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ title: MoEngage Destination
4
4
5
5
## Getting Started
6
6
7
-
Once you add the Segment-Moengage library to your app, you can enable MoEngage from the Segment App. These new settings can take up to an hour to propagate to your existing users. For new users, it'll be instantaneous!
7
+
Once you add the Segment-MoEngage library to your app, you can enable MoEngage from the Segment App. These new settings can take up to an hour to propagate to your existing users. For new users, it'll be instantaneous!
8
8
9
9
The Segment-MoEngage Integration is a bundled integration, meaning it requires that you add a client-side integration to your app.
10
10
@@ -29,7 +29,7 @@ users it’ll be instantaneous! Segment-MoEngage Integration is a bundled integr
29
29
30
30
To get started with MoEngage on iOS, first integrate your app with the [MoEngage-Segment-iOS](https://github.com/moengage/MoEngage-Segment-iOS) library. You can integrate MoEngage and Segment with [CocoaPods](http://cocoapods.org).
31
31
32
-
*Initialise pod with pod init command, this will create a podfile for your project.
32
+
*Initialize pod with pod init command, this will create a podfile for your project.
33
33
* Update your podfile by adding pod '**Segment-MoEngage**' as shown below:
34
34
35
35
```ruby
@@ -100,24 +100,17 @@ To differentiate between those, use one of the method below:
100
100
101
101
```objc
102
102
//For new Install call following
103
-
[[MoEngage sharedInstance]appStatus:INSTALL];
103
+
[[MoEngage sharedInstance]appStatus:INSTALL];
104
104
105
105
//For an app update call following
106
-
[[MoEngage sharedInstance]appStatus:UPDATE];
106
+
[[MoEngage sharedInstance]appStatus:UPDATE];
107
107
```
108
108
109
109
Read more on [install/update differentiation](https://docs.moengage.com/docs/installupdate-differentiation).
110
110
111
-
### Data Redirection
111
+
### Set the data center
112
112
113
-
You can redirect data to MoEngage' EU servers. To redirect data to, call the `redirectDataToRegion:` method to redirect the data to the `MOE_REGION_EU` region defined in the 'DataRedirectionRegion' Enumerator. Use the method as shown below:
114
-
115
-
```objc
116
-
[MoEngage redirectDataToRegion:MOE_REGION_EU];
117
-
```
118
-
119
-
> note ""
120
-
> **IMPORTANT**: If you use MoEngage in the EU, you must [sign up for the EU environment](https://app-eu.moengage.com).
113
+
By default, the data center setting in the SDK is set to `DATA_CENTER_01`. Follow the steps in the [MoEngage-DataRedirection](https://docs.moengage.com/docs/data-redirection) to update the data center value. Ifnot set correctly, several features of the MoEngageSDK will not function.
121
114
122
115
### Using features provided in the MoEngage SDK
123
116
@@ -128,7 +121,7 @@ Push Notifications are a great way to keep your users engaged and informed about
128
121
129
122
**Segment Push Implementation:**
130
123
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)..
124
+
1. Follow the directions to register for push notifications [with the Segment SDK](/docs/connections/sources/catalog/libraries/mobile/ios/#how-do-i-use-push-notifications).
132
125
133
126
2. In your application’s application:didReceiveRemoteNotification: method, add the following:
134
127
```objc
@@ -149,14 +142,16 @@ Push Notifications are a great way to keep your users engaged and informed about
149
142
For information about the MoEngage push implementation, see [**Push Notifications**](https://docs.moengage.com/docs/push-notifications) in the MoEngage documentation.
150
143
151
144
152
-
#### In-App Messaging
145
+
#### In-app messaging
146
+
In-App Messages are custom views which you can send to a set of users to show custom messages, give new offers, or direct to a specific page. For more information about In-app messaging, see [MoEngage - In-App NATIV](https://docs.moengage.com/docs/in-app-nativ)
153
147
154
-
In-App Messaging are custom views which you can send to a segment of users to show custom messages or give new offers or take to some specific pages. Follow the link to know more about inApp Messaging and how to use it in your application:
Create targeted or automated App Inbox/NewsFeed messages that can be grouped into various categories, and target your users with different updates or offers that can stay in the Inbox/Feed over a designated period of time. For more information about cards, see [MoEngage - Cards](https://docs.moengage.com/docs/ios-cards).
157
151
158
-
#### GDPR Compliance
159
-
The MoEngage SDK is GDPR compliant, follow the doc in this [link](https://docs.moengage.com/docs/gdpr-compliance-1) to know how to use opt-outs for different features.
152
+
153
+
#### Compliance
154
+
To make the App compliant with policies i.e,GDPR while using our SDK, follow the doc in this [link](https://docs.moengage.com/docs/gdpr-compliance-1).
160
155
161
156
### Segment Docs
162
157
For more info on using **Segment for iOS** refer to [**Developer Docs**](/docs/connections/sources/catalog/libraries/mobile/ios/) provided by Segment.
@@ -166,7 +161,7 @@ For more info on using **Segment for iOS** refer to [**Developer Docs**](/docs/c
166
161
167
162
To use MoEngage in an Android app, you must perform the following steps to set up your environment.
To enable the full functionality of MoEngage (like Push Notifications, InApp Messaging), complete the following steps in your Android app.
172
167
@@ -209,19 +204,22 @@ Analytics analytics = new Analytics.Builder(this, "write_key")
209
204
```
210
205
211
206
212
-
### Initialise the MoEngage SDK
207
+
### Initialize the MoEngage SDK
208
+
209
+
Copy the APP ID from the Settings Page `Dashboard --> Settings --> App --> General` and initialize the MoEngage SDK in the onCreate method of the `Application` class
213
210
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()`
211
+
> info ""
212
+
> **Note:** MoEngage recommend that you initialize the SDK on the main thread inside `onCreate()` and not create a worker thread and initialize the SDK on that thread.
215
213
216
214
```java
217
215
// this is the instance of the application class and "XXXXXXXXXXX" is the APP ID from the dashboard.
218
216
MoEngage moEngage = new MoEngage.Builder(this, "XXXXXXXXXXX")
219
217
.enableSegmentIntegration()
220
218
.build();
221
-
MoEngage.initialise(moEngage);
219
+
MoEngage.initialize(moEngage);
222
220
```
223
221
224
-
### Install/Update Differentiation
222
+
### Install or update differentiation
225
223
This is required for migrations to the MoEngage Platform so the SDK can determine whether the user is a new user on your app, or an existing user who updated to the latest version.
226
224
227
225
If the user was already using your application and has just updated to a new version which has the MoEngage SDK, below is an example call:
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.
239
+
Copy the Server Key from the FCM console and add it to the MoEngage Dashboard. For more information about retrieving the Server Key, see [MoEngage - Getting FCM Server Key](https://docs.moengage.com/docs/getting-fcmgcm-server-key). To upload it, go to the Settings Page `Dashboard --> Settings --> Channel --> Push --> Mobile Push --> Android` and add the Server Key and package name.
243
240
**Please make sure you add the keys both in Test and Live environment.**
244
241
245
242
#### Add meta information for push notification
246
243
247
-
Add the AppId, and the small and large notification icons to the builder:
244
+
To display push notifications, some metadata regarding the notification is required. For example, the small icon and large icon drawables are mandatory.
245
+
246
+
Refer to the [MoEngage - 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.
247
+
248
+
Use the `configureNotificationMetaData()` to pass on the configuration to the SDK.
For showing Push notifications there are 2 important steps:
260
263
261
264
1. Registration for Push, for example generating push token.
262
265
2. Receiving the Push payload from Firebase Cloud Messaging(FCM) service and showing the notification on the device.
263
266
267
+
##### Push registration and receiving handled by the application
264
268
265
-
#### Opt out of MoEngage Registration
266
-
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
+
###### Opt-out of MoEngage registration
269
270
270
-
To opt-out of MoEngage's token registration mechanism call in the `optOutTokenRegistration()` on the `MoEngage.Builder` as shown below
271
+
To opt-out of MoEngage token registration mechanism disable token registration while configuring FCM in the `MoEngage.Builder` as shown below
271
272
272
273
```java
273
274
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.
282
+
###### Pass the push token to the MoEngage SDK
283
+
284
+
The Application must pass the Push Token received from FCM to the MoEngage SDK for the MoEngage platform to send out push notifications to the device.
284
285
Use the below API to pass the push token to the MoEngage SDK.
>*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
290
292
-
#### Pass the Push payload to the MoEngage SDK
291
+
Please make sure token is passed to MoEngage SDK whenever push token is refreshed and on application update. Passing token on application update is important for migration to the MoEngage Platform.
292
+
293
+
###### Passing the Push payload to the MoEngage SDK
294
+
293
295
To pass the push payload to the MoEngage SDK call the MoEngage API from the `onMessageReceived()` from the Firebase receiver.
294
296
Before passing the payload to the MoEngage SDK you should check if the payload is from the MoEngage platform using the helper API provided by the SDK.
295
297
@@ -301,7 +303,8 @@ if (MoEPushHelper.getInstance().isFromMoEngagePlatform(remoteMessage.getData()))
301
303
}
302
304
```
303
305
304
-
#### Push Registration and Receiving handled by SDK
306
+
##### Push Registration and Receiving handled by SDK
307
+
305
308
Add the below code in your manifest file.
306
309
307
310
```xml
@@ -311,30 +314,17 @@ Add the below code in your manifest file.
311
314
</intent-filter>
312
315
</service>
313
316
```
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
317
318
+
When the MoEngage SDK handles push registration, it optionally provides a callback to the Application whenever a new token is registered or the token is refreshed.
317
319
318
-
#### Configure Geo-fence
320
+
An application can get this callback by implementing `FirebaseEventListener` and registering for a callback in the Application class `onCreate()` using `MoEFireBaseHelper.getInstance().addEventListener()`
319
321
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:
322
+
Refer to the [MoEngage - 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.
321
323
322
-
```java
323
-
MoEngage moEngage =
324
-
new MoEngage.Builder(this, "XXXXXXXXXXX")
325
-
.enableLocationServices()
326
-
.enableSegmentIntegration()
327
-
.build();
328
-
MoEngage.initialise(moEngage);
329
-
```
330
324
331
-
> note ""
332
-
> **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
325
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.
326
+
#### Declare and configure Rich Landing Activity:
335
327
336
-
####
337
-
Declaring & configuring Rich Landing Activity:
338
328
Add the following snippet and replace `[PARENT_ACTIVITY_NAME]` with the name of the parent
339
329
activity; `[ACTIVITY_NAME]` with the activity name which should be the parent of the Rich Landing Page
340
330
@@ -348,17 +338,21 @@ Add the following snippet and replace `[PARENT_ACTIVITY_NAME]` with the name of
348
338
349
339
You are now all set up to receive push notifications from MoEngage. For more information on features provided in MoEngage Android SDK refer to the following links:
@@ -430,7 +424,7 @@ If you already have these files,
430
424
Use [Identify](/docs/sources/website/analytics.js/#identify) to track user specific attributes. This is equal to [tracking user attributes](https://docs.moengage.com/docs/tracking-web-user-attributes) on MoEngage. MoEngage supports traits supported by Segment as well as custom traits.
431
425
432
426
### Track
433
-
Use [track](/docs/sources/website/analytics.js/#track) to track events and user behaviour in your app. This will send the event to MoEngage with the associated properties. Tracking events is essential and will help you create segments for engaging users.
427
+
Use [track](/docs/sources/website/analytics.js/#track) to track events and user behavior in your app. This will send the event to MoEngage with the associated properties. Tracking events is essential and will help you create segments for engaging users.
434
428
435
429
### Reset
436
430
If your website supports the ability for a user to logout and login with a new identity, then you’ll need to call [reset](/docs/sources/website/analytics.js/#reset-logout) method in `analytics.js`.
0 commit comments