All Products
Search
Document Center

Mobile Platform as a Service:Adapt mPaaS to targetSdkVersion 33

Last Updated:Oct 23, 2023

mPaaS has added support for targetSdkVersion 33 from mPaaS 10.2.3.35. If your application needs to upgrade the targetSdkVersion to version 33, use the mPaaS plug-in to update the SDK to version 10.2.3.35 or later, and perform adaptation and regression related functions as described in the following section.

Adapt to targetSdkVersion 33

Prerequisites

Please refer to the following documents to ensure that your application has completed the adaptation of targetSdkVersion old version:

Modify targetSdkVersion

AAR integration mode

Modify the targetSdkVersion 33 attribute in the build.gradle file under the main module of the project.

Portal&Bundle integration method

Modify the targetSdkVersion 33 attribute in the build.gradle file under the main module of the Portal project.

The targetSdkVersion in the Bundle project may not be modified, but shall not be higher than that in the Portal project.

Notification runtime permission

Android 13 adds permission POST_NOTIFICATIONS for:

  • For applications with targetSdkVersion < 33, the system will automatically pop up a window to apply for this permission when the application creates the first notification channel;

  • For applications with targetSdkVersion ≥ 33, the application can apply for this permission independently;

For more information, see Notification runtime permissions.

Message Push Service

If you have access to Message Push Service and need to push messages through a self-built channel and display them in the notification bar, you need to add this permission in AndroidManifest.xml:

<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>

And dynamically apply for this permission at the right time. If you do not apply for this permission or the user refuses this permission, no matter whether you customize message processing, the messages received by the self-built channel cannot be notified and displayed in the notification bar.

Fine-grained media permissions

Since Android 13, the READ_EXTERNAL_STORAGE permission no longer takes effect. The permission is split into the following three permissions:

  • READ_MEDIA_IMAGES

  • READ_MEDIA_VIDEO

  • READ_MEDIA_AUDIO

For applications with targetSdkVersion ≥ 33:

  • Dynamically apply for READ_EXTERNAL_STORAGE permissions, there will be no pop-up window;

  • The newly installed application uses the checkSelfPermission to check READ_EXTERNAL_STORAGE permissions and always returns false;

  • If the application with the previous targetSdkVersion < 33 has been granted the READ_EXTERNAL_STORAGE permission, the application with the targetSdkVersion ≥ 33 will be automatically granted the above three permissions after being upgraded through the override installation;

You can add one or more of the following permissions to the AndroidManifest.xml based on your business requirements:

<uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO"/>
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO"/>

And change the logic for dynamically applying for or checking READ_EXTERNAL_STORAGE permissions in the code to one or more of the preceding three permissions.

Mini program multimedia

If you want to use the mini program multimedia API , you must add this permission to the AndroidManifest.xml.

<uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>

And dynamically apply for the permission at the right time. If the permission is not applied or the user refuses the permission, the mini program multimedia API will not be able to obtain the pictures in the system album.

Scan

If you are connected to the Scan or Scan AI , and:

  • To use the window scanning function, you need to apply for the following permissions;

  • To use the full-screen code scanning function and integrate multimedia or mini program multimedia, you need to apply for the following permissions;

  • To use the full-screen code scanning function and do not integrate multimedia or mini program multimedia, you do not need to apply for the following permissions;

  • To use the custom code scanning function and use multimedia components to obtain album pictures, you need to apply for the following permissions:

  • To use the custom code scanning function and directly call the system album at the same time. You do not need to apply for the following permissions;

You need to add this permission to the AndroidManifest.xml:

<uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>

And dynamically apply for the permission at an appropriate time. If the permission is not applied for or the user denies the permission, the mPaaS multimedia component cannot obtain the images in the system album when you click the album button.

Regression test

Devices for full regression test must include devices with Android 13 or later.

In regression test, you need to focus on the following component features (if used):

Components

Validation Item

Message Push Service

  • Whether the user-created channel can display notifications after receiving messages

  • Whether the vendor channel pushes messages normally

H5 container

  • Whether the function is normal when files, images, and videos are selected

  • Whether the page is normal when switch network as the page is open

Mini program

  • Whether the multimedia API is normal

Scan

  • Whether the function is normal when select pictures for the album

Social sharing

  • Whether the function is normal when share content to every platform

Threat awareness

  • Whether each field of the basic information is normal