Integrate with iOS
This topic describes how to integrate the device ID component into an iOS client. The device ID component supports three connection types: integration based on the mPaaS framework, integration based on an existing project using the mPaaS plugin, and integration based on an existing project using CocoaPods. For more information, see Connection types. Select a connection type based on your needs.
Prerequisites
Your project is now integrated with mPaaS. For more information, see the following:
Add the SDK
Select an approach to add the SDK based on your connection type.
Use the mPaaS Xcode Extension. This approach applies if you use the integration based on the mPaaS framework or integration based on an existing project using the mPaaS plugin connection type.
In the Xcode menu bar, choose Editor > mPaaS > Edit Project to open the project editing page.
Select Device ID, save the settings, and then click Start Editing to add the component.
Use the cocoapods-mPaaS plugin. This approach applies if you use the integration based on an existing project using CocoaPods connection type.
In the Podfile, add the dependency for the device ID component using
mPaaS_pod "mPaaS_UTDID".Run
pod installto complete the integration.
Use the SDK
After you add the SDK, you can call the following method to retrieve the unique ID of the device:
/**
Get the unique device ID generated by the SDK.
*/
+ (NSString *)deviceId;For more information, see the MPUtdidInterface.h file in MPUTDIDAdapter.framework.