Skip to content

Commit b7dd243

Browse files
committed
MoEngage SDK version 12, 8 document update
1 parent f015001 commit b7dd243

File tree

1 file changed

+59
-24
lines changed
  • src/connections/destinations/catalog/moengage

1 file changed

+59
-24
lines changed

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

Lines changed: 59 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The Segment-MoEngage Integration is a bundled integration, meaning it requires t
1111
## Setup MoEngage in your Segment Workspace:
1212

1313
To setup MoEngage do the following :
14-
1. First get your key([AppID](http://app.moengage.com/v3/#/settings/0/0)) from the MoEngage dashboard.
14+
1. First get your key(AppID) from the MoEngage dashboard, `Dashboard --> Settings --> App --> General`.
1515
2. Go to your **Segment workspace**, go to **Destinations** and select **MoEngage**.
1616
3. Enable the MoEngage Destination.
1717
4. Go to the MoEngage Settings and enter the MoEngage AppID, obtained in **Step1**.
@@ -43,14 +43,22 @@ To get started with MoEngage on iOS, first integrate your app with the [MoEngage
4343
4444
### Configure the Segment SDK:
4545
46-
Now head to the App Delegate file, and setup the Segment SDK by adding `SEGMoEngageIntegrationFactory` instance to the `SEGAnalyticsConfiguration` as shown below:
46+
Now head to the App Delegate file, and setup the Segment SDK by
47+
1. Importing `SEGMoEngageIntegrationFactory.h` and `SEGMoEngageInitializer.h`.
48+
2. Initialize `MOSDKConfig` object and call `initializeDefaultInstance:` method of `SEGMoEngageInitializer`.
49+
3. Initialize `SEGMoEngageIntegrationFactory` instance to the `SEGAnalyticsConfiguration` as shown below:
4750
4851
```objc
49-
#import <SEGMoEngageIntegrationFactory.h> // This line is key for MoEngage integration
52+
#import <SEGMoEngageIntegrationFactory.h>
53+
#import <SEGMoEngageInitializer.h>
5054
#import <SEGAnalytics.h>
5155
5256
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
5357
58+
//Initialize SDKConfig object and call initializeDefaultInstance: method of SEGMoEngageInitializer
59+
MOSDKConfig* sdkConfig = [[MOSDKConfig alloc] initWithAppID:@"YOUR APP ID"];
60+
[SEGMoEngageInitializer initializeDefaultInstance:sdkConfig];
61+
5462
// Add your configuration key from Segment
5563
SEGAnalyticsConfiguration *config = [SEGAnalyticsConfiguration configurationWithWriteKey:@"configuration key"];
5664
@@ -100,17 +108,17 @@ To differentiate between those, use one of the method below:
100108

101109
```objc
102110
//For new Install call following
103-
[[MoEngage sharedInstance] appStatus:INSTALL];
111+
[[MoEngage sharedInstance] appStatus:AppStatusInstall];
104112
105113
//For an app update call following
106-
[[MoEngage sharedInstance] appStatus:UPDATE];
114+
[[MoEngage sharedInstance] appStatus:AppStatusUpdate];
107115
```
108116

109-
Read more on [install/update differentiation](https://docs.moengage.com/docs/installupdate-differentiation).
117+
Read more on [install/update differentiation](https://developers.moengage.com/hc/en-us/articles/4403910297620).
110118

111119
### Set the data center
112120

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.
121+
By default, the data center setting in the SDK is set to `data_center_01`. Follow the steps in the [MoEngage - Data Redirection](https://developers.moengage.com/hc/en-us/articles/4403910162452-Data-Center) to update the data center value. If not set correctly, several features of the MoEngage SDK will not function.
114122

115123
### Using features provided in the MoEngage SDK
116124

@@ -139,19 +147,19 @@ Push Notifications are a great way to keep your users engaged and informed about
139147
```
140148
141149
**MoEngage Push Implementation:**
142-
For information about the MoEngage push implementation, see [**Push Notifications**](https://docs.moengage.com/docs/push-notifications) in the MoEngage documentation.
150+
For information about the MoEngage push implementation, see [**Push Notifications**](https://developers.moengage.com/hc/en-us/articles/4403943988756) in the MoEngage documentation.
143151
144152
145153
#### 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)
154+
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://developers.moengage.com/hc/en-us/articles/4404155127828-In-App-Nativ)
147155
148156
149157
#### 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).
158+
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://developers.moengage.com/hc/en-us/articles/4404058438676-Cards-in-iOS).
151159
152160
153161
#### 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).
162+
To make the App compliant with policies i.e,GDPR while using our SDK, follow the doc in this [link](https://developers.moengage.com/hc/en-us/articles/4403905438228-SDK-initialisation).
155163
156164
### Segment Docs
157165
For more info on using **Segment for iOS** refer to [**Developer Docs**](/docs/connections/sources/catalog/libraries/mobile/ios/) provided by Segment.
@@ -180,9 +188,9 @@ The MoEngage SDK depends on the below Jetpack libraries provided by Google for i
180188
done already.
181189
182190
```groovy
183-
implementation("androidx.core:core:1.3.1")
184-
implementation("androidx.appcompat:appcompat:1.2.0")
185-
implementation("androidx.lifecycle:lifecycle-process:2.2.0")
191+
implementation("androidx.core:core:1.6.0")
192+
implementation("androidx.appcompat:appcompat:1.3.1")
193+
implementation("androidx.lifecycle:lifecycle-process:2.4.0")
186194
```
187195
Refer to the [SDK Configuration](https://developers.moengage.com/hc/en-us/articles/4401984733972-Android-SDK-Configuration) documentation to know more about the build config and other libraries used by the SDK.
188196
@@ -216,22 +224,33 @@ Copy the APP ID from the Settings Page `Dashboard --> Settings --> App --> Gener
216224
MoEngage moEngage = new MoEngage.Builder(this, "XXXXXXXXXXX")
217225
.enableSegmentIntegration()
218226
.build();
219-
MoEngage.initialize(moEngage);
227+
MoEngage.initialiseDefaultInstance(moEngage);
220228
```
229+
### Exclude MoEngage Storage File from Auto-Backup
230+
Auto backup service of Andriod periodically backs up the Shared Preference file, Database files, and so on.
231+
232+
For more information, refer to [Auto Backup](https://developer.android.com/guide/topics/data/autobackup).
233+
234+
The backup results in MoEngage SDK identifiers to be backed up and restored after re-install.
235+
The restoration of the identifier results in your data being corrupted and the user not being reachable using push notifications.
236+
237+
To ensure data is not corrupted after a backup is restored, opt-out of MoEngage SDK storage files.
238+
239+
Refer to the [documentation](https://developers.moengage.com/hc/en-us/articles/4401999257236-Exclude-MoEngage-Storage-File-from-Auto-Backup) for further details.
221240
222241
### Install or update differentiation
223242
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.
224243
225244
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:
226245
227246
```java
228-
MoEHelper.getInstance(getApplicationContext()).setAppStatus(AppStatus.UPDATE);
247+
MoEAnalyticsHelper.INSTANCE.setAppStatus(context, AppStatus.UPDATE);
229248
```
230249
231250
If this is a fresh install:
232251
233252
```java
234-
MoEHelper.getInstance(getApplicationContext()).setAppStatus(AppStatus.INSTALL);
253+
MoEAnalyticsHelper.INSTANCE.setAppStatus(context, AppStatus.INSTALL);
235254
```
236255
237256
### Configure Push Notifications
@@ -243,18 +262,18 @@ Copy the Server Key from the FCM console and add it to the MoEngage Dashboard. T
243262
244263
To display push notifications, some metadata regarding the notification is required. For example, the small icon and large icon drawables are mandatory.
245264
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.
265+
Refer to the [MoEngage - NotificationConfig](https://moengage.github.io/android-api-reference/core/com.moengage.core.config/-notification-config/index.html) API reference for all the possible options.
247266
248267
Use the `configureNotificationMetaData()` to pass on the configuration to the SDK.
249268
250269
251270
```java
252271
MoEngage moEngage =
253272
new MoEngage.Builder(this, "XXXXXXXXXX")
254-
.configureNotificationMetaData(new NotificationConfig(R.drawable.small_icon, R.drawable.large_icon, R.color.notiColor, "sound", true, true, true))
273+
.configureNotificationMetaData(new NotificationConfig(R.drawable.small_icon, R.drawable.large_icon))
255274
.enablePartnerIntegration(IntegrationPartner.SEGMENT)
256275
.build();
257-
MoEngage.initialize(moEngage);
276+
MoEngage.initialiseDefaultInstance(moEngage);
258277
```
259278
260279
#### Configuring Firebase Cloud Messaging
@@ -272,11 +291,11 @@ To opt-out of MoEngage token registration mechanism disable token registration w
272291
273292
```java
274293
MoEngage moEngage = new MoEngage.Builder(this, "XXXXXXXXXX")
275-
.configureNotificationMetaData(new NotificationConfig(R.drawable.small_icon, R.drawable.large_icon, R.color.notiColor, "sound", true, true, true))
294+
.configureNotificationMetaData(new NotificationConfig(R.drawable.small_icon, R.drawable.large_icon))
276295
.configureFcm(FcmConfig(false))
277296
.enablePartnerIntegration(IntegrationPartner.SEGMENT)
278297
.build();
279-
MoEngage.initialize(moEngage);
298+
MoEngage.initialiseDefaultInstance(moEngage);
280299
```
281300
282301
###### Pass the push token to the MoEngage SDK
@@ -297,8 +316,8 @@ Before passing the payload to the MoEngage SDK you should check if the payload i
297316
298317
```java
299318
if (MoEPushHelper.getInstance().isFromMoEngagePlatform(remoteMessage.getData())) {
300-
MoEFireBaseHelper.Companion.getInstance().passPushPayload(getApplicationContext(), remoteMessage.getData());
301-
}else{
319+
MoEFireBaseHelper.getInstance().passPushPayload(getApplicationContext(), remoteMessage.getData());
320+
} else {
302321
// your app's business logic to show notification
303322
}
304323
```
@@ -321,10 +340,26 @@ An application can get this callback by implementing `FirebaseEventListener` and
321340

322341
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.
323342

343+
##### Callbacks
344+
345+
We recommend you to add the callbacks in the onCreate() of the Application class since these callbacks can be triggered even when the application is in the background.
346+
347+
###### Token Callback
348+
349+
When MoEngage SDK handles push registration it optionally provides a callback to the application whenever a new token is registered or the token is refreshed. To get the token callback implement the [TokenAvailableListener](https://moengage.github.io/android-api-reference/pushbase/com.moengage.pushbase.listener/-token-available-listener/index.html) and register for the callback using [MoEFireBaseHelper.getInstance().addTokenListener()](https://moengage.github.io/android-api-reference/moe-push-firebase/com.moengage.firebase/-mo-e-fire-base-helper/add-token-listener.html).
350+
351+
###### Non-MoEngage Payload
352+
353+
If you are using the receiver provided by the SDK in your application's manifest file, SDK provides a callback in case a push payload is received for any other server apart from MoEngage Platform. To get a callback implement the [NonMoEngagePushListener](https://moengage.github.io/android-api-reference/moe-push-firebase/com.moengage.firebase.listener/-non-mo-engage-push-listener/index.html) and register for the callback using [MoEFireBaseHelper.getInstance().addNonMoEngagePushListener()](https://moengage.github.io/android-api-reference/moe-push-firebase/com.moengage.firebase/-mo-e-fire-base-helper/add-non-mo-engage-push-listener.html).
324354

325355

326356
#### Declare and configure Rich Landing Activity:
327357

358+
A rich landing page can be used to open a web URL inside the app via a push campaign.
359+
360+
The below configuration is only required if you want to add a parent activity to the Rich landing page, if not you can move to the next section.
361+
To use a rich landing page you need to add the below code in the AndroidManifest.xml
362+
328363
Add the following snippet and replace `[PARENT_ACTIVITY_NAME]` with the name of the parent
329364
activity; `[ACTIVITY_NAME]` with the activity name which should be the parent of the Rich Landing Page
330365

0 commit comments

Comments
 (0)