All Products
Search
Document Center

Mobile Platform as a Service:Use the SDK

Last Updated:Jun 03, 2026

Shows how to integrate the mPaaS Customer Data Platform (CDP) promotion component into your iOS app using the provided SDK.

To download the code examples, see Get code examples. For interface details, see Delivery interface class.

Start the component

Call the start method in the - (void)application:(UIApplication *)application beforeDidFinishLaunchingWithOptions:(NSDictionary *)launchOptions method to initialize and start the CDP promotion component after the app launches.

[CDPPromotionInterface start];

Configure the component

Use the following options to set login/logout notification names and enable location information for the CDP promotion component.

// Configure the notification name for login. Default is empty.
[CDPPromotionInterface sharedInstance].loginNotificationName = @"xxxx";
// Configure the notification name for logout. Default is empty.
[CDPPromotionInterface sharedInstance].logoutNotificationName = @"xxxx";
// Configure whether to use location information.
[CDPPromotionInterface sharedInstance].useLbsInfo = YES;

Register the container plugin

Register the container plugin to enable JavaScript APIs (JSAPIs) on H5 pages for ad delivery.

Ad delivery on H5 pages requires the H5 container. Before registering the container plugin, initialize the H5 container in the - (void)application:(UIApplication *)application beforeDidFinishLaunchingWithOptions:(NSDictionary *)launchOptions method of DTFrameworkInterface. For details, see the H5 container initialization document.

 // Initialize the container.
 [MPNebulaAdapterInterface initNebula];

After initializing the H5 container, follow Custom plugins to register the container plugin for the CDP promotion component, using the configuration shown below.

注册容器插件

Report sharing data

When a user shares content from an ad landing page, call the share data reporting API to capture the event. The data is then available in the console dashboard.

  1. Listen for share click events.

     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(shareAd:) name:MPCDPDidShareAdNotification object:nil];
  2. In the notification handler, implement your sharing logic, then call the API to report the share after the content is shared successfully.

     - (void)shareAd:(NSNotification *)notification {
         NSString *adUrl = notification.object;
         // Initiate the share.
         // ...
         // Report the shared ad.
         [CDPPromotionInterface reportShareAdAction];
     }