Skip to main content
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

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.0SDK Version 9.0.0
MODataCenterMoEngageDataCenter
For information on the new DataCenter value, refer to this link.

Install/Update differentiation

SDK Version 8.x.xSDK 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.xSDK Version 9.0.0
MOAnalyticsMoEngageSDKAnalytics
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.xSDK Version 9.0.0
MOInappMoEngageSDKInApp
MOInApp.sharedInstance().showCampaign()MoEngageSDKInApp.sharedInstance.showInApp()
MOInApp.sharedInstance().showNudge(at: NudgePositionTop)MoEngageSDKInApp.sharedInstance.showNudge(atPosition: NudgePositionTop)
MOInAppNativeDelegateMoEngageInAppNativeDelegate
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.xSDK Version 9.0.0
MOCardsMoEngageSDKCards
MOCardsDelegateMoEngageCardsDelegate
MOCardsViewControllerDelegateMoEngageCardsDelegate
@objc optional func cardsSyncedSuccessfully(forAccountMeta accountMeta: MOAccountMeta)@objc optional func cardsSyncedSuccessfully(forAccountMeta accountMeta: MoEngageAccountMeta)

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.xSDK Version 9.0.0
MORichNotificationMoEngageSDKRichNotification
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)

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.xSDK Version 9.0.0
MORealTimeTriggerMoEngageSDKRealTimeTrigger
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.xSDK Version 9.0.0
MOGeofenceMoEngageSDKGeofence
MOGeofenceHandler.sharedInstance().delegate = selfMoEngageSDKGeofence.sharedInstance.setGeofenceDelegate(self)
For more info on the Geofence feature, refer to our documentation here.

Inbox

SDK Version 8.x.xSDK Version 9.0.0
MOInboxMoEngageSDKInbox
MOInboxViewControllerMoEngageInboxViewController
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.