All Products
Search
Document Center

Mobile Platform as a Service:Integrate Device ID into iOS

Last Updated:Oct 26, 2023

This guide introduces how to integrate Device ID to iOS client. You can integrate Device ID to iOS client based on native project with CocoaPods.

Prerequisites

You have connected your project to mPaaS. For more information, refer to: Integrate mPaaS based on an existing project and CocoaPods.

Add the SDK

Use the cocoapods-mPaaS plug-in to add the SDK.

  1. In the Podfile file, add mPaaS_pod "mPaaS_UTDID" to add the dependencies of the Device ID component.

  2. Run pod install to connect the component to the mPaaS.

Use the SDK

After you add the SDK, you can call the following method to obtain the unique device ID:

/**
 Obtain the unique device ID generated by the SDK.
 */
+ (NSString *)deviceId;

For more information, see the MPUtdidInterface.h file in MPUTDIDAdapter.framework.