All Products
Search
Document Center

Mobile Platform as a Service:Initialize configuration

Last Updated:Aug 29, 2023

The configuration initialization covers the following four steps:

  1. Initialize mPaaS

  2. Configure Mini Program signature verification

  3. Configure AndroidManifest

  4. Apply for UC kernel

Initialize mPaaS

It is required to initialize mPaaS when you use the native AAR access method.

  1. Create the MyApplication class in the project.

  2. Add the following code in the class.

     public class MyApplication extends Application {
      @Override
      protected void attachBaseContext(Context base) {
          super.attachBaseContext(base);
          // set mPaaS initialization callback
          QuinoxlessFramework.setup(this, new IInitCallback() {
              @Override
              public void onPostInit() {
                  // Initialize mini program public resource package
                  H5Utils.setProvider(H5AppCenterPresetProvider.class.getName(),new TinyAppCenterPresetProvider());
              }
          });
      }
      @Override
      public void onCreate() {
          super.onCreate();
          // Initialize mPaaS 
          QuinoxlessFramework.init();
      }
     }
  3. Open AndroidManifest.xml, and add the following code in <application> label to set Application.

    android:name=".MyApplication"

Configure Mini Program signature verification

  1. Create the file custom_config.json under assets/config.

  2. Enter the following code in the file.

     [
         {
             "value": "NO",
             "key": "h5_shouldverifyapp"
         }
     ]

    If the value is “NO”, it means disabling mini program signature verification while “YES” means enabling signature verification. It is “YES” by default if no value is filled. In the development and debugging stage, you can disable signature verification for quick access. It is recommended to enable signature verification before releasing the mini program.

    For how to set mini program package signature verification, refer to Configure mini program package.

Configure AndroidManifest

In this tutorial, the native AAR method is used to access, so the following configuration needs to be added to AndroidManifest.xml:

<application>
    ···
    <meta-data android:name="nebula.android.meta.enable" android:value="true"/>
  ···
</application>

Apply for UC kernel

Note

Due to product policy changes, UC is no longer fully open for applications. Public application for UC Key will not be supported from December 1, 2022. The UC Key application form needs to be submitted, and the staff will review and give feedback on the results of the application.

  1. Click mPaaS > Basic tool > Generate UC Key Signature to open the Query Signature window.

  2. In the Query Signature window, enter the necessary configuration information, and click Next to continue.

  3. Copy the generated SHA1 string.

  4. Log in to the mPaaS console, and please search for the group number 31591197 with DingTalk to join DingTalk group for further communication.

    1. Select the product to which the problem belongs. You can quickly search for mPaaS.

    2. Select the problem type. You can select Mini Program or Access Android.

    3. Select the expected solution Create ticket.

    4. On the ticket submission page, enter the following information to obtain the UC SDK Key.

      • Priority: Required, select Important or Normal based on the actual situation.

      • Problem description: Required, the following information is required.

        • Summary: For example, apply for UC SDK Key.

        • Package Name: In this tutorial, it is com.mpaas.demo.mpaasminiprogram.

        • SHA1: The SHA1 string obtained in above step.

      • Mobile: Required.

      • Email: Required.

  5. Click Submit. After a while, the technical support staff will give you a feedback.

  6. Fill in the Key you obtained in the previous step into the file AndroidManifest.xml.

    <meta-data android:name="UCSDKAppKey" android:value="UC SDK Key information"/>
    Note

    The authorization information of UC SDK is associated with the package name and signature of the apk. Therefore, if UCWebView doesn't not work, you should check if the signature and package name are consistent with that used for applying for the key.

At this point, you have completed the initialization configuration.