Update the Pod names
From SDK version8.2.0 , we have updated some of the pod names. Refer to the table below to update the podfile.
| SDK Version 7.0.0 | SDK Version 8.2.0 |
|---|---|
| import MOGeofence | import MoEngageGeofence |
| import MORichNotification | import MoEngageRichNotification |
Update the Import
From SDK version8.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.0 | SDK Version 8.2.0 |
|---|---|
| import MoEngage | import MoEngageSDK |
| import MOInApp | import MoEngageInApps |
| import MOCards | import MoEngageCards |
| import MOGeofence | import MoEngageGeofence |
| import MORichNotification | import MoEngageRichNotification |
Initialisation Method Changes
We have deprecated the previous initialization methods and have introduced new methods. Deprecated methods- Swift
- Objective-C
Setting Region/Data Center
MODataCenter: DataCenter names have been updated in the SDK version8.2.0. Following are the existing ones used in the SDK version in 7.0.0 and above.
- Swift
- Objective-C
App Target: Setting App Group ID
App Group ID for App target was earlier set usingsetAppGroupID:, 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]
- Swift
- Objective-C
Enable Logs Changes
For troubleshooting, the method to enable SDK logs has been changed fromdebug: 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]
- Swift
- Objective-C
Tracking User Attributes
From SDK version8.2.0 , we have deprecated a couple of UserAttribute methods. Refer to the table below to get the updated method
| SDK Version 7.0.0 | SDK 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().setUserLocationLatitude | MOAnalytics.sharedInstance.setLocation(MOGeoLocation(withLatitude: userLocationLat, andLongitude: userLocationLng)) |
| (userLocationLat, andLongitude: userLocationLng) | |
| MoEngage.sharedInstance().setUserAttributeISODateString | MOAnalytics.sharedInstance.setUserAttributeISODate(“2020-01-12T18:45:59Z”, withAttributeName: “Date Attr 2”)e |
| (“2020-01-12T18:45:59Z”, forKey: “DateAttr2”) | |
| MoEngage.sharedInstance().setUserAttributeTimestamp | MOAnalytics.sharedInstance.setUserAttributeEpochTime(663333, withAttributeName: “Date Attr 3”) |
| (NSDate().timeIntervalSince1970, forKey:“DateAttr3”) | |
| MoEngage.sharedInstance().setUserAttributeLocationLatitude | MOAnalytics.sharedInstance.setLocation(MOGeoLocation.init(withLatitude: 72.90909, andLongitude: 12.34567), withAttributeName: “attribute name”) |
| (12.98798, longitude: 34.98789, forKey:“location_attribute_name”) |
Push Notification
From SDK version8.2.0 , we have updated methods related to Push Notification.Refer to the table below to use the updated one.
| SDK Version 7.0.0 | SDK Version 8.2.0 |
|---|---|
| MoEngage.sharedInstance().disableBadgeReset = true | MoEngage.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 = self | MOMessaging.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 version8.2.0 , we have updated methods related to Geofence. Refer to the table below to use the updated one.
| SDK Version 7.0.0 | SDK Version 8.2.0 |
|---|---|
| MOGeofenceHandler.sharedInstance()?.startGeofenceMonitoring() | MOGeofence.sharedInstance.startGeofenceMonitoring() |
| MOGeofenceHandler.sharedInstance().delegate = self | MOGeofence.sharedInstance.setGeofenceDelegate(self) |
InApp
From SDK version8.2.0 , we have updated methods related to InApp.Refer to the table below to use the updated one.
| SDK Version 7.0.0 | SDK Version 8.2.0 |
|---|---|
| MOInApp.sharedInstance().show() | MOInApp.sharedInstance().showCampaign() |
| MOInApp.sharedInstance().inAppDelegate = self; | MOInApp.sharedInstance().setInAppDelegate(self) |
Cards
From SDK version8.0.0 , we have updated methods related to Cards. Refer to the table below to use the updated one.
| SDK Version 7.0.0 | SDK Version 8.2.0 |
|---|---|
| MoEngageCards.sharedInstance.pushCardsViewController | MOCards.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 = delegate | MOCards.sharedInstance.setCardsDelegate(delegate: self) |