Migration to SDK version 9.0.0

We have made some class name updates in SDK version 9.0.0 and if you are someone who was using an 8.2.0 and above version of our SDK and planning to move to version 9.0.0 or above, here are the changes to be made while migrating.

Initialization Method Changes

We have updated the initialization method of SDK with SDKConfig as the required parameter and sdkState as an optional parameter.

Deprecated methods

Swift Objective-C
let sdkConfig = MOSDKConfig(withAppID: "YOUR Workspace ID")
#if DEBUG
	MoEngage.sharedInstance().initializeDefaultTestInstance(with: sdkConfig, andLaunchOptions: launchOptions)
#else
	MoEngage.sharedInstance().initializeDefaultLiveInstance(with: sdkConfig, andLaunchOptions: launchOptions)
#endif

For information on the new initialization methods, refer to this link.

Setting Region/Data Center

MoEngageDataCenter: DataCenter class name has been updated in the SDK version 9.0.0. Following are the existing ones used in the SDK version in 8.2.0 and above.

SDK Version 8.2.0 SDK Version 9.0.0
MODataCenter

MoEngageDataCenter

For information on the new DataCenter value, refer to this link.

Install/Update differentiation

SDK Version 8.x.x SDK Version 9.0.0

MoEngage.sharedInstance().appStatus(.install)

MoEngageSDKAnalytics.sharedInstance.appStatus(.install)

For information on the new DataCenter value, refer to this document.

Analytics:

From SDK version 9.0.0, we have updated methods related to Analytics. Refer to the table below to use the updated one.

SDK Version 8.x.x SDK Version 9.0.0
MOAnalytics

MoEngageSDKAnalytics

For information on tracking user attributes methods, refer to this document.

 

Inapps

From SDK version 9.0.0, we have updated methods related to Inapps. Refer to the table below to use the updated one.

SDK Version 8.x.x SDK Version 9.0.0
MOInapp

MoEngageSDKInApp

MOInApp.sharedInstance().showCampaign()

MoEngageSDKInApp.sharedInstance.showInApp()

MOInApp.sharedInstance().showNudge(at: NudgePositionTop)

MoEngageSDKInApp.sharedInstance.

showNudge(atPosition: NudgePositionTop)

MOInAppNativeDelegate 

MoEngageInAppNativeDelegate

func inAppShown(withCampaignInfoinappCampaign: MOInAppCampaign, foraccountMeta: MOAccountMeta)

func inAppShown(withCampaignInfoinappCampaign: MoEngageInAppCampaign, forAccountMetaaccountMeta: MoEngageAccountMeta)

func inAppDismissed(withCampaignInfoinappCampaign: MOInAppCampaign, foraccountMeta: MOAccountMeta)

func inAppDismissed(withCampaignInfoinappCampaign: MoEngageInAppCampaign,forAccountMetaaccountMeta: MoEngageAccountMeta)

func inAppClicked(withCampaignInfoinappCampaign: MOInAppCampaign, andCustomActionInfocustomAction: MOInAppAction, foraccountMeta: MOAccountMeta)

func inAppClicked(withCampaignInfoinappCampaign: MoEngageInAppCampaign, andCustomActionInfocustomAction: MoEngageInAppAction, forAccountMetaaccountMeta: MoEngageAccountMeta)

func inAppClicked(withCampaignInfoinappCampaign: MOInAppCampaign, andNavigationActionInfonavigationAction: MOInAppAction, foraccountMeta: MOAccountMeta)

func inAppClicked(withCampaignInfoinappCampaign: MoEngageInAppCampaign, andNavigationActionInfonavigationAction: MoEngageInAppAction, forAccountMetaaccountMeta: MoEngageAccountMeta)

func selfHandledInAppTriggered(withInfoinappCampaign: MOInAppSelfHandledCampaign, foraccountMeta: MOAccountMeta)

func selfHandledInAppTriggered(withInfoinappCampaign: MoEngageInAppSelfHandledCampaign, forAccountMetaaccountMeta: MoEngageAccountMeta)

For more details, refer to the InApp Native developer documentation.

Cards

From SDK version 9.0.0, we have updated methods related to Cards. Refer to the table below to use the updated one.

SDK Version 8.x.x SDK Version 9.0.0
MOCards

MoEngageSDKCards

MOCardsDelegate

MoEngageCardsDelegate

MOCardsViewControllerDelegate

 

MoEngageCardsDelegate

@objc optional func cardsSyncedSuccessfully

(forAccountMeta accountMeta: MOAccountMeta)

 

@objc optional func cardsSyncedSuccessfully(forAccountMeta accountMeta: MoEngageAccountMeta)

For more details, refer to SDK Methods for Cards.

Push Notification

From SDK version 9.0.0, we have updated methods related to Push Notifications. Refer to the table below to use the updated one.

SDK Version 8.x.x SDK Version 9.0.0
MORichNotification

MoEngageSDKRichNotification

MoEngage.sharedInstance().

registerForRemoteNotification(withCategories: nil, withUserNotificationCenterDelegate: self)

MoEngageSDKMessaging.sharedInstance.

registerForRemoteNotification(withCategories: nil, andUserNotificationCenterDelegate: self)

MoEngage.sharedInstance().

setPushToken(deviceToken)

MoEngageSDKMessaging.sharedInstance.

setPushToken(deviceToken)

MoEngage.sharedInstance().

didFailToRegisterForPush()

MoEngageSDKMessaging.sharedInstance.

didFailToRegisterForPush()

MoEngage.sharedInstance().

userNotificationCenter(center, didReceive: response)

MoEngageSDKMessaging.sharedInstance.

userNotificationCenter(center, didReceive: response)

MoEngage.sharedInstance().

didReceieveNotificationinApplication(application, withInfo: userInfo)

MoEngageSDKMessaging.sharedInstance.

didReceieveNotification(inApplication: application, withInfo: userInfo)

MoEngage.sharedInstance().

setDisableBadgeReset(true)

MoEngageSDKMessaging.sharedInstance.

disableBadgeReset(true)

MOMessaging.sharedInstance.

setMessagingDelegate(self)

MoEngageSDKMessaging.sharedInstance.

setMessagingDelegate(self)

For more details, refer to SDK Methods for Cards.

RealTimeTrigger:

From SDK version 9.0.0, we have updated methods related to RealTime Trigger. Refer to the table below to use the updated one.

SDK Version 8.x.x SDK Version 9.0.0

MORealTimeTrigger

MoEngageSDKRealTimeTrigger

For more details, refer to Real-Time Triggers.

Location Triggered

From SDK version 9.0.0, we have updated methods related to Location Trigger. Refer to the table below to use the updated one.

SDK Version 8.x.x SDK Version 9.0.0
MOGeofence

MoEngageSDKGeofence

MOGeofenceHandler.sharedInstance().delegate = self

MoEngageSDKGeofence.sharedInstance.setGeofenceDelegate(self)

For more info on the Geofence feature, refer to our documentation here.

Inbox

SDK Version 8.x.x SDK Version 9.0.0
MOInbox

MoEngageSDKInbox

MOInboxViewController

MoEngageInboxViewController

func getInboxViewController(withUIConfiguration uiConfig: MOInboxUIConfiguration? = nil, withInboxWithControllerDelegate delegate: MOInboxViewControllerDelegate? = nil, forAppID appID: String? = nil, withCompletionBlock completionBlock: @escaping (MOInboxViewController?)->())

 func getInboxViewController(withUIConfiguration uiConfig: MoEngageInboxUIConfiguration? = nil, withInboxWithControllerDelegate delegate: MoEngageInboxViewControllerDelegate? = nil, forAppID appID: String? = nil, withCompletionBlock completionBlock: @escaping (MoEngageInboxViewController?)->())

For more information on the Geofence feature, refer to this document.

Previous

Next

Was this article helpful?
0 out of 0 found this helpful

How can we improve this article?