Skip to main content
We have made some major changes in SDK version 8.2.0, and if you are someone who was using an older version of our SDK and planning to move to version 8.2.0 or above, here are the changes to be made while migrating:

Update the Pod names

From SDK version 8.2.0 , we have updated some of the pod names. Refer to the table below to update the podfile.
SDK Version 7.0.0SDK Version 8.2.0
import MOGeofenceimport MoEngageGeofence
import MORichNotificationimport MoEngageRichNotification

Update the Import

From SDK version 8.2.0 , we have updated some of the framework names. Refer to the table below to update the import statement for the modules.
SDK Version 7.0.0SDK Version 8.2.0
import MoEngageimport MoEngageSDK
import MOInAppimport MoEngageInApps
import MOCardsimport MoEngageCards
import MOGeofenceimport MoEngageGeofence
import MORichNotificationimport MoEngageRichNotification

Initialisation Method Changes

We have deprecated the previous initialization methods and have introduced new methods. Deprecated methods
let sdkConfig = MOSDKConfig(withAppID: "YOUR Workspace ID")
#if DEBUG
	MoEngage.sharedInstance().initializeTest(with: sdkConfig, andLaunchOptions: launchOptions)
#else
	MoEngage.sharedInstance().initializeLive(with: sdkConfig, andLaunchOptions: launchOptions)
#endif
For info on the new initialization methods, refer to this link.

Setting Region/Data Center

MODataCenter: DataCenter names have been updated in the SDK version 8.2.0. Following are the existing ones used in the SDK version in 7.0.0 and above.
typedef enum {              
      DATA_CENTER_01, 
      DATA_CENTER_02, 
      DATA_CENTER_03 
}MODataCenter;
For info on the new DataCenter value, refer to this link.

App Target: Setting App Group ID

App Group ID for App target was earlier set using setAppGroupID:, which is no longer supported. Make use of the MOSDKConfig to configure the same in the latest SDK versions(Refer to the link for more info) Older method[6.3.1 and below]
MoEngage.setAppGroupID("AppGroupID")

Enable Logs Changes

For troubleshooting, the method to enable SDK logs has been changed from debug: to enableSDKLogs :. The earlier method was used, as shown below, and for the updated implementation in the latest SDK versions, refer to the following doc: Older method[6.3.1 and below]
MoEngage.debug(LOG_ALL)

Tracking User Attributes

From SDK version 8.2.0 , we have deprecated a couple of UserAttribute methods. Refer to the table below to get the updated method
SDK Version 7.0.0SDK Version 8.2.0
MoEngage.sharedInstance().setUserUniqueID(UNIQUE_ID)MOAnalytics.sharedInstance.setUniqueID(UNIQUE_ID)
MoEngage.sharedInstance().setUserName(userName)MOAnalytics.sharedInstance.setName(userName)
MoEngage.sharedInstance().setUserLastName(userLastname)MOAnalytics.sharedInstance.setLastName(userLastname)
MoEngage.sharedInstance().setUserFirstName(userFirstName)MOAnalytics.sharedInstance.setFirstName(userFirstName)
MoEngage.sharedInstance().setUserEmailID(userEmailID)MOAnalytics.sharedInstance.setEmailID(userEmailID)
MoEngage.sharedInstance().setUserMobileNo(userPhoneNo)MOAnalytics.sharedInstance.setMobileNumber(userPhoneNo)
MoEngage.sharedInstance().setUserGender(MALE)MOAnalytics.sharedInstance.setGender(.male)
MoEngage.sharedInstance().setUserDateOfBirth(userBirthdate)MOAnalytics.sharedInstance.setDateOfBirth(userBirthdate)
MoEngage.sharedInstance().setUserLocationLatitudeMOAnalytics.sharedInstance.setLocation(MOGeoLocation(withLatitude: userLocationLat, andLongitude: userLocationLng))
(userLocationLat, andLongitude: userLocationLng)
MoEngage.sharedInstance().setUserAttributeISODateStringMOAnalytics.sharedInstance.setUserAttributeISODate(“2020-01-12T18:45:59Z”, withAttributeName: “Date Attr 2”)e
(“2020-01-12T18:45:59Z”, forKey: “DateAttr2”)
MoEngage.sharedInstance().setUserAttributeTimestampMOAnalytics.sharedInstance.setUserAttributeEpochTime(663333, withAttributeName: “Date Attr 3”)
(NSDate().timeIntervalSince1970, forKey:“DateAttr3”)
MoEngage.sharedInstance().setUserAttributeLocationLatitudeMOAnalytics.sharedInstance.setLocation(MOGeoLocation.init(withLatitude: 72.90909, andLongitude: 12.34567), withAttributeName: “attribute name”)
(12.98798, longitude: 34.98789, forKey:“location_attribute_name”)
For more information on tracking user attributes methods, refer to this doc.

Push Notification

From SDK version 8.2.0 , we have updated methods related to Push Notification.Refer to the table below to use the updated one.
SDK Version 7.0.0SDK Version 8.2.0
MoEngage.sharedInstance().disableBadgeReset = trueMoEngage.sharedInstance().setDisableBadgeReset(true)
MORichNotification.handle(request, withContentHandler: contentHandler)MORichNotification.handle(richNotificationRequest: request, withContentHandler: contentHandler)
MOPushTemplateHandler.sharedInstance().addPushTemplate(to: self, with: notification)MORichNotification.addPushTemplate(toController: self, withNotification: notification)
//Set messaging delegate//Set messaging delegate
MOMessaging.sharedInstance().messagingDelegate = selfMOMessaging.sharedInstance.setMessagingDelegate(self)

RealTimeTrigger and Inbox Module

From SDK version 8.0.0, RealTimeTrigger and Inbox Module are separated from the MoEngage-iOS-SDK.Hence, they must be integrated explicitly. Refer to the link for the document.

Location Triggered

From SDK version 8.2.0 , we have updated methods related to Geofence. Refer to the table below to use the updated one.
SDK Version 7.0.0SDK Version 8.2.0
MOGeofenceHandler.sharedInstance()?.startGeofenceMonitoring()MOGeofence.sharedInstance.startGeofenceMonitoring()
MOGeofenceHandler.sharedInstance().delegate = selfMOGeofence.sharedInstance.setGeofenceDelegate(self)
For more info on the Geofence feature, refer to this doc.

InApp

From SDK version 8.2.0 , we have updated methods related to InApp.Refer to the table below to use the updated one.
SDK Version 7.0.0SDK Version 8.2.0
MOInApp.sharedInstance().show()MOInApp.sharedInstance().showCampaign()
MOInApp.sharedInstance().inAppDelegate = self;MOInApp.sharedInstance().setInAppDelegate(self)
For more info on the InApp feature, refer to this doc.

Cards

From SDK version 8.0.0 , we have updated methods related to Cards. Refer to the table below to use the updated one.
SDK Version 7.0.0SDK Version 8.2.0
MoEngageCards.sharedInstance.pushCardsViewControllerMOCards.sharedInstance.pushCardsViewController
(toNavigationController: self.navigationController!)(toNavigationController: self.navigationController!)
MoEngageCards.sharedInstance.presentCardsViewController()MOCards.sharedInstance.presentCardsViewController()
MoEngageCards.sharedInstance.getCardsViewController()MOCards.sharedInstance.getCardsViewController(withUIConfiguration: nil, withCardsViewControllerDelegate: self, forAppID: “YOUR Workspace ID”) cardsController in print(“fetched CardsController”)
MoEngageCards.sharedInstance.getNewCardsCount()MOCards.sharedInstance.getNewCardsCount(forAppID: “YOUR Workspace ID”, withCompletionBlock: count, accountMeta in print(“Card count is (count)”) )
MoEngageCards.sharedInstance.getUnclickedCardsCount()MOCards.sharedInstance.getUnclickedCardsCount(forAppID: “YOUR Workspace ID”) count, accountMeta in print(“UnClicked Card count is (count)“)
MoEngageCards.sharedInstance.cardsDelegate = delegateMOCards.sharedInstance.setCardsDelegate(delegate: self)
For more info on the Cards feature, refer to this doc.