All Products
Search
Document Center

Adcanced operations

Last Updated: Aug 24, 2021

After completing integrating the CDP component and basic booth configuration, you can also make some other settings, such as controlling the maximum range of the popup, forcing a complete refresh of all booths, setting expansion parameters for RPC requests. The following shows the details of these advanced operations.

Control the maximum range of the popup

  • Applicable scenario: When you want a larger pop-up page.
  • Applicable SDK version: 10.1.60 and above.
  • Operation: Preset via XML.
    • Specify the maximum height of the pop-up page:
      1. <meta-data
      2. android:name="com.mpaas.cdp.space.height"
      3. android:value="xxx" />
    • Specify the maximum width of the pop-up page:
      1. <meta-data
      2. android:name="com.mpaas.cdp.space.width"
      3. android:value="xxx" />
    • Specify whether the resolution of the pop-up page is in pixel or dip. The default is dip:
      1. <meta-data
      2. android:name="com.mpaas.cdp.space.dpmode "
      3. android:value="dp" />

Force a complete refresh of all booths

  • Applicable scenario: When the user switches account or region during usage.
  • Applicable SDK version: 10.1.68 and above.
  • Operation: Call the API.

    1. Obtain the CDP interface service, so that follow-up related functions can use this service to call.
      1. private CdpAdvertisementService findCdpApiService() {
      2. return LauncherApplicationAgent.getInstance()
      3. .getMicroApplicationContext()
      4. .findServiceByInterface(CdpAdvertisementService.class.getName());
      5. }
    2. Update and refresh all CDP booth data.

      1. findCdpApiService().refresh(new CdpAdvertisementService.IRefreshZoneCallBack(){});

Set extension parameters for RPC requests

  • Applicable SDK version: 10.1.68 and above.

    1. MCdpApi.API.api().setExportApi(new IMCdpExportApi (){
    2. public Map<String, String> getExtras() {
    3. HashMap<String, String> extras = new HashMap<>();
    4. extras.put("cdp_extend_params_xxxx", String.valueOf(1));
    5. return extras;
    6. }
    7. });