Skip to content

Commit 1069d36

Browse files
author
markzegarelli
authored
Merge pull request #1435 from segmentio/moengage_destination_documentation_update
MoEngage destination documentation update
2 parents 0b5342d + 16f08ee commit 1069d36

File tree

1 file changed

+66
-72
lines changed
  • src/connections/destinations/catalog/moengage

1 file changed

+66
-72
lines changed

src/connections/destinations/catalog/moengage/index.md

Lines changed: 66 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: MoEngage Destination
44

55
## Getting Started
66

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!
88

99
The Segment-MoEngage Integration is a bundled integration, meaning it requires that you add a client-side integration to your app.
1010

@@ -29,7 +29,7 @@ users it’ll be instantaneous! Segment-MoEngage Integration is a bundled integr
2929

3030
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).
3131

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.
3333
* Update your podfile by adding pod '**Segment-MoEngage**' as shown below:
3434

3535
```ruby
@@ -100,24 +100,17 @@ To differentiate between those, use one of the method below:
100100

101101
```objc
102102
//For new Install call following
103-
[[MoEngage sharedInstance]appStatus:INSTALL];
103+
[[MoEngage sharedInstance] appStatus:INSTALL];
104104
105105
//For an app update call following
106-
[[MoEngage sharedInstance]appStatus:UPDATE];
106+
[[MoEngage sharedInstance] appStatus:UPDATE];
107107
```
108108

109109
Read more on [install/update differentiation](https://docs.moengage.com/docs/installupdate-differentiation).
110110

111-
### Data Redirection
111+
### Set the data center
112112

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 - Data Redirection](https://docs.moengage.com/docs/data-redirection) to update the data center value. If not set correctly, several features of the MoEngage SDK will not function.
121114

122115
### Using features provided in the MoEngage SDK
123116

@@ -128,7 +121,7 @@ Push Notifications are a great way to keep your users engaged and informed about
128121
129122
**Segment Push Implementation:**
130123
131-
1. Follow the directions to register for push notifications [using Segment'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).
132125
133126
2. In your application’s application:didReceiveRemoteNotification: method, add the following:
134127
```objc
@@ -149,14 +142,16 @@ Push Notifications are a great way to keep your users engaged and informed about
149142
For information about the MoEngage push implementation, see [**Push Notifications**](https://docs.moengage.com/docs/push-notifications) in the MoEngage documentation.
150143
151144
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)
153147
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:
155-
[**InApp NATIV**](https://docs.moengage.com/docs/in-app-nativ)
156148
149+
#### Cards
150+
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).
157151
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).
160155
161156
### Segment Docs
162157
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
166161
167162
To use MoEngage in an Android app, you must perform the following steps to set up your environment.
168163
169-
![Downlaod](https://api.bintray.com/packages/moengage/android-sdk/moengage-segment-integration/images/download.svg)
164+
![MavenBadge](https://maven-badges.herokuapp.com/maven-central/com.moengage/moengage-segment-integration/badge.svg)
170165
171166
To enable the full functionality of MoEngage (like Push Notifications, InApp Messaging), complete the following steps in your Android app.
172167
@@ -209,19 +204,22 @@ Analytics analytics = new Analytics.Builder(this, "write_key")
209204
```
210205
211206
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
213210
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.
215213
216214
```java
217215
// this is the instance of the application class and "XXXXXXXXXXX" is the APP ID from the dashboard.
218216
MoEngage moEngage = new MoEngage.Builder(this, "XXXXXXXXXXX")
219217
.enableSegmentIntegration()
220218
.build();
221-
MoEngage.initialise(moEngage);
219+
MoEngage.initialize(moEngage);
222220
```
223221
224-
### Install/Update Differentiation
222+
### Install or update differentiation
225223
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.
226224
227225
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:
@@ -232,64 +230,68 @@ MoEHelper.getInstance(getApplicationContext()).setAppStatus(AppStatus.UPDATE);
232230
233231
If this is a fresh install:
234232
235-
236233
```java
237234
MoEHelper.getInstance(getApplicationContext()).setAppStatus(AppStatus.INSTALL);
238235
```
239236
240237
### Configure Push Notifications
241238
242-
Copy the Server Key from the FCM console and add it to the MoEngage Dashboard(Not sure where to find the Server Key refer to [Getting FCM Server Key](https://docs.moengage.com/docs/getting-fcmgcm-server-key). To upload it, go to [Settings Page](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.
243240
**Please make sure you add the keys both in Test and Live environment.**
244241
245242
#### Add meta information for push notification
246243
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.
249+
248250
249251
```java
250252
MoEngage moEngage =
251253
new MoEngage.Builder(this, "XXXXXXXXXX")
252-
.setNotificationSmallIcon(R.drawable.icon)
253-
.setNotificationLargeIcon(R.drawable.ic_launcher)
254-
.enableSegmentIntegration()
254+
.configureNotificationMetaData(new NotificationConfig(R.drawable.small_icon, R.drawable.large_icon, R.color.notiColor, "sound", true, true, true))
255+
.enablePartnerIntegration(IntegrationPartner.SEGMENT)
255256
.build();
256-
MoEngage.initialise(moEngage);
257+
MoEngage.initialize(moEngage);
257258
```
258259
260+
#### Configuring Firebase Cloud Messaging
261+
259262
For showing Push notifications there are 2 important steps:
260263
261264
1. Registration for Push, for example generating push token.
262265
2. Receiving the Push payload from Firebase Cloud Messaging(FCM) service and showing the notification on the device.
263266
267+
##### Push registration and receiving handled by the application
264268
265-
#### Opt out of MoEngage Registration
266-
267-
> note ""
268-
> By default, the MoEngage SDK 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
269270
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
271272
272273
```java
273274
MoEngage moEngage = new MoEngage.Builder(this, "XXXXXXXXXX")
274-
.setNotificationSmallIcon(R.drawable.icon)
275-
.setNotificationLargeIcon(R.drawable.ic_launcher)
276-
.optOutTokenRegistration()
277-
.enableSegmentIntegration()
275+
.configureNotificationMetaData(new NotificationConfig(R.drawable.small_icon, R.drawable.large_icon, R.color.notiColor, "sound", true, true, true))
276+
.configureFcm(FcmConfig(false))
277+
.enablePartnerIntegration(IntegrationPartner.SEGMENT)
278278
.build();
279-
MoEngage.initialise(moEngage);
279+
MoEngage.initialize(moEngage);
280280
```
281281
282-
#### Pass the Push Token To the MoEngage SDK
283-
The Application would need to pass the Push Token received from FCM to the MoEngage SDK for 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.
284285
Use the below API to pass the push token to the MoEngage SDK.
285286
286287
```java
287-
MoEFireBaseHelper.Companion.getInstance().passPushToken(getApplicationContext(), token);
288+
MoEFireBaseHelper.getInstance().passPushToken(getApplicationContext(), token);
288289
```
289-
> note ""
290-
> *Note:* Be sure to pass the token to the MoEngage SDK whenever you refresh the push token, and on every application update. Passing the token on application update is important for migration to the MoEngage Platform.
291290
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+
293295
To pass the push payload to the MoEngage SDK call the MoEngage API from the `onMessageReceived()` from the Firebase receiver.
294296
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.
295297
@@ -301,7 +303,8 @@ if (MoEPushHelper.getInstance().isFromMoEngagePlatform(remoteMessage.getData()))
301303
}
302304
```
303305

304-
#### Push Registration and Receiving handled by SDK
306+
##### Push Registration and Receiving handled by SDK
307+
305308
Add the below code in your manifest file.
306309

307310
```xml
@@ -311,30 +314,17 @@ Add the below code in your manifest file.
311314
</intent-filter>
312315
</service>
313316
```
314-
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.
315-
Application can get this callback by implementing `FirebaseEventListener` and registering for a callback in the Application class' `onCreate()` using `MoEFireBaseHelper.Companion.getInstance().setEventListener()`
316317

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.
317319

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()`
319321

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.
321323

322-
```java
323-
MoEngage moEngage =
324-
new MoEngage.Builder(this, "XXXXXXXXXXX")
325-
.enableLocationServices()
326-
.enableSegmentIntegration()
327-
.build();
328-
MoEngage.initialise(moEngage);
329-
```
330324

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.
333325

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:
335327

336-
####
337-
Declaring & configuring Rich Landing Activity:
338328
Add the following snippet and replace `[PARENT_ACTIVITY_NAME]` with the name of the parent
339329
activity; `[ACTIVITY_NAME]` with the activity name which should be the parent of the Rich Landing Page
340330

@@ -348,17 +338,21 @@ Add the following snippet and replace `[PARENT_ACTIVITY_NAME]` with the name of
348338

349339
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:
350340

351-
* [Push Notifications](http://docs.moengage.com/docs/push-configuration)
341+
* [Push Notifications](http://docs.moengage.com/docs/push-configuration)
342+
343+
* [Geofence](https://docs.moengage.com/docs/android-geofence)
344+
345+
* [In-App messaging](https://docs.moengage.com/docs/android-in-app-nativ)
352346

353-
* [In-App messaging](http://docs.moengage.com/docs/configuring-in-app-nativ)
347+
* [Notification Center](https://docs.moengage.com/docs/android-notification-center)
354348

355-
* [Notification Center](http://docs.moengage.com/docs/notification-center)
349+
* [Advanced Configuration](https://docs.moengage.com/docs/android-advanced-integration)
356350

357-
* [Advanced Configuration](https://docs.moengage.com/docs/advanced-integration)
351+
* [API Reference](https://moengage.github.io/android-api-reference/-modules.html)
358352

359-
* [API Reference](https://moengage.github.io/MoEngage-Android-SDK/)
353+
* [Compliance](https://docs.moengage.com/docs/android-compliance)
360354

361-
* [GDPR Compliance](https://docs.moengage.com/docs/gdpr-compliance)
355+
* [Release Notes](https://docs.moengage.com/docs/segment-android-releases)
362356

363357

364358
### Identify
@@ -430,7 +424,7 @@ If you already have these files,
430424
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.
431425

432426
### 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.
434428

435429
### Reset
436430
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

Comments
 (0)