> ## Documentation Index
> Fetch the complete documentation index at: https://moengage.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Migration to SDK version 8.2.0

> Migrate your MoEngage iOS SDK to version 8.2.0 with updated pod names, imports, and initialization.

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.0         | SDK Version 8.2.0               |
| :------------------------ | :------------------------------ |
| import MOGeofence         | import MoEngageGeofence         |
| import MORichNotification | import 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.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**

<CodeGroup>
  ```swift Swift wrap theme={null}
  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
  ```

  ```objective-c Objective C wrap theme={null}
  MOSDKConfig* sdkConfig = [[MOSDKConfig alloc] initWithAppID:@"YOUR Workspace ID"];
  #ifdef DEBUG
     [[MoEngage sharedInstance] initializeTestWithConfig:sdkConfig andLaunchOptions:launchOptions];
  #else
     [[MoEngage sharedInstance] initializeLiveWithConfig:sdkConfig andLaunchOptions:launchOptions];
  #endif
  ```
</CodeGroup>

For info on the new initialization methods, refer to this [link](/developer-guide/ios-sdk/sdk-integration/basic/sdk-initialization).

# 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.

<CodeGroup>
  ```swift Swift theme={null}
  typedef enum {              
        DATA_CENTER_01, 
        DATA_CENTER_02, 
        DATA_CENTER_03 
  }MODataCenter;
  ```

  ```objective-c Objective C theme={null}
  typedef enum {
      DATA_CENTER_01,
      DATA_CENTER_02,
      DATA_CENTER_03
  }MODataCenter;
  ```
</CodeGroup>

For info on the new DataCenter value, refer to this [link](/developer-guide/ios-sdk/sdk-integration/basic/data-center).

# 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](/developer-guide/ios-sdk/sdk-integration/basic/sdk-initialization) for more info)

**Older method\[6.3.1 and below]**

<CodeGroup>
  ```swift Swift theme={null}
  MoEngage.setAppGroupID("AppGroupID")
  ```

  ```objective-c Objective C theme={null}
  [MoEngage setAppGroupID:@"AppGroupID"];
  ```
</CodeGroup>

# 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](/developer-guide/ios-sdk/troubleshooting-and-faqs/troubleshooting-and-faqs-ios):

**Older method\[6.3.1 and below]**

<CodeGroup>
  ```swift Swift theme={null}
  MoEngage.debug(LOG_ALL)
  ```

  ```objective-c Objective C theme={null}
  [MoEngage debug:LOG_ALL];
  ```
</CodeGroup>

# 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.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") |                                                                                                                                                 |

For more information on tracking user attributes methods, refer to this [doc](/developer-guide/ios-sdk/data-tracking/basic/tracking-user-attributes).

# 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.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](/developer-guide/ios-sdk/push/advanced) 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.0                                             | SDK Version 8.2.0                                   |
| :------------------------------------------------------------ | :-------------------------------------------------- |
| MOGeofenceHandler.sharedInstance()?.startGeofenceMonitoring() | MOGeofence.sharedInstance.startGeofenceMonitoring() |
| MOGeofenceHandler.sharedInstance().delegate = self            | MOGeofence.sharedInstance.setGeofenceDelegate(self) |

For more info on the Geofence feature, refer to this [doc](/developer-guide/ios-sdk/push/optional/location-triggered).

# 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.0                              | SDK 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](/developer-guide/ios-sdk/in-app-messages/in-app-nativ).

# 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.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)                                                                                                                                            |

For more info on the Cards feature, refer to this [doc](/developer-guide/ios-sdk/cards/cards-in-i-os).
