All Products
Search
Document Center

API description

Last Updated: Aug 24, 2021

This topic describes the APIs of the Mobile Content Delivery Platform (MCDP) component and the startup page APIs.

Delivery APIs

Delivery API class

The delivery API class is the unified entry point for delivery functions. You can call the operations in the class to implement the related MCDP functions.

  1. @interface CDPPromotionInterface : NSObject
  2. @end

Start component

API definition

  1. + (void)start;

API description

You can call this operation to start the MCDP component, including initializing all delivery data and pre-adding resource pictures.

Examples

  1. [CDPPromotionInterface start];

View MCDP component version

API definition

  1. + (NSString *)sdkVersion;

API description

You can call this operation to view the version number of the MCDP component.

Applicable versions: The API is available in version 3.0.0 and above.

Examples

  1. NSString cdpVersion = [CDPPromotionInterface sdkVersion];

Report advertisement sharing events.

API definition

  1. + (NSString *)reportShareAdAction;

API description

You can call this operation to report advertisement sharing events so that the sharing data can be displayed on the activity effect page of the MCDP console. The sharing data includes the sharing times and the number of sharing devices. The sharing times refers to the number of times that an advertisement is tapped and shared on the client page during a certain period of time. The number of devices with sharing operations refers to the total number of deduplicated devices on which the Share button is tapped on the client page during a certain period of time. For more information about advertisement sharing data, see View activity effect.

Applicable versions: The API is available in version 3.0.0 and above.

Examples

  1. CDPPromotionInterface reportShareAdAction];

Delivery property

Configure delivery properties, including logon notification name, logout notification name, and whether to use positioning information.

Property definition

  1. @interface CDPPromotionInterface : NSObject
  2. //The following are subject to user's configuration.
  3. @property (nonatomic, strong) NSString* loginNotificationName; // The logon notification name. This parameter has no default value.
  4. @property (nonatomic, strong) NSString* logoutNotificationName; // The logout notification name. This parameter has no default value.
  5. @property (nonatomic, assign) BOOL useLbsInfo; // Whether to use location information, the default is NO.
  6. @end

Property description

Parameter Type Required Description
loginNotificationName NSString No The logon notification name. This parameter has no default value. MCDP will refresh the content delivered to the corresponding user according to the logon notification.
logoutNotificationName NSString No The name of the logout notification.This parameter has no default value. MCDP will clean up the cached delivery data according to the logout notification.
useLbsInfo BOOL No Whether to use location information inside MCDP, the default is NO, representing not to use location information.

Examples

  1. [CDPPromotionInterface sharedInstance].loginNotificationName = @"xxxx";

Startup page APIs

MCDP provides a series of C methods to execute the logic related to the startup page, which includes:

  1. Determine whether to display the startup page.
  2. Open the startup page.
  3. Send notification that the startup page will close.

Determine whether to display the startup page

API definition

  1. BOOL splashScreenExist(BOOL shouldShowSplashScreen);

API description

Determine if the startup page needs to be displayed based on user-defined rules and MCDP internal rules.

Parameter description

Parameter Type Required Description
shouldShowSplashScreen BOOL Yes Determine if the startup page needs to be displayed based on user-defined rules.

Examples

  1. BOOL shouldShowSplash = YES;
  2. // Whether to display advertisement on the startup page.
  3. shouldShowSplash = splashScreenExist(shouldShowSplash);

Open the startup page

API definition

  1. UIWindow * APSplashScreenStart(void (^dismiss)(void));

API description

Open the startup page and display the startup page advertisement.

Parameter description

Parameter Type Required Description
dismiss block Yes Callback block of closing the startup page.

Returned value description

Parameter Description
UIWindow The created startup page window.

Examples

  1. UIWindow *splashWindow = APSplashScreenStart(^{
  2. // The callback of closing the startup page.
  3. // Do something.
  4. });

Send notification of startup page closing

API definition

  1. void APWillKillSplashScreen(void);

API description

After the framework startup is loaded, notifies the framework that the startup page is about to close. After the notification, the startup page may not be closed immediately.

Examples

  1. APWillKillSplashScreen();