Advanced operations

Updated at:

After integrating the MCDP component and completing the 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:

          <meta-data
            android:name="com.mpaas.cdp.space.height"
            android:value="xxx" />
    • Specify the maximum width of the pop-up page:

          <meta-data
            android:name="com.mpaas.cdp.space.width"
            android:value="xxx" />
    • Specify whether the resolution of the pop-up page is in pixel or dip. The default is dip:

           <meta-data
            android:name="com.mpaas.cdp.space.dpmode "
            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.

          private CdpAdvertisementService findCdpApiService() {
               return LauncherApplicationAgent.getInstance()
                       .getMicroApplicationContext()
                       .findServiceByInterface(CdpAdvertisementService.class.getName());
            }
    2. Update and refresh all CDP booth data.

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

Set extension parameters for RPC requests

Applicable SDK version: 10.1.68 and above.

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