Follow this guide to configure mobile application services and develop push features for your proprietary app.
Prerequisites
You have set device alert rules on the Human-Computer Interaction page of product development in the console. For example, you can configure the system to push a message to the app when a door lock is opened or when the PM2.5 level exceeds 200. For more information, see Configure device alerting.
You have created a proprietary app. For more information, see Create a proprietary app.
Background information
Alibaba Cloud Mobile Push is a mobile push service with an online delivery rate of over 98%. It handled a peak message push rate of over 5,000 messages per second during the Double 11 shopping festival. For more information, see Mobile Push. The IoT Platform uses Alibaba Cloud Mobile Push and integrates device management capabilities to push device messages to your app.
Configure the mobile application push service
Log on to the IoT Platform console.
Select a project. On the project homepage, click the name of your proprietary app.
Go to the SDKs and Plug-ins page of your proprietary app. Click Not Set for Message Push.

Configure the message push service for your iOS application.
The push service for iOS applications does not distinguish between online and offline pushes. It uses the official Apple Push Notification service (APNs) that Apple provides to developers. Follow these steps.

Click Upload File and upload the APNs push certificate.
Enter the password for the push certificate and click Authenticate Certificate.
The iOS push service can be called only after the certificate and password are correctly configured and successfully authenticated.

Click Test Push. In the dialog box that appears, enter the deviceToken information. To obtain the deviceToken, see the didRegisterForRemoteNotificationsWithDeviceToken method in SDK Initialization.
Click Test to push a test message.

(Optional) Configure the offline push service for Android.
Android applications support online push by default, and no extra configuration is needed. The platform also provides offline push capabilities for popular mobile devices, such as Huawei, Xiaomi, FCM, OPPO, and VIVO.
NoteThe following steps outline the general configuration process for third-party push services. The steps are for reference only. The actual procedure may vary depending on the third-party provider.
Huawei
Register your app on the HUAWEI Developers website. After your app is approved, you will receive an AppID and AppSecret from Huawei.
Enable the message push feature in the push section of the HUAWEI Developers platform.
Add the message receipt webhook address on the HUAWEI Developers platform:
https://amspush-ack.aliyuncs.com/hw/.On the Message Push Settings page in the IoT Platform console, configure the Huawei AppID and AppSecret.
ImportantMake sure that you activate the push channel feature in the Huawei console and that your app status is Under Review or Approved. The channel does not work if the app is in a draft state.
Xiaomi
Register your app on the Xiaomi Open Platform to obtain a Xiaomi AppID, AppKey, and AppSecret.
Enable the message push feature in the push section of the Xiaomi developer platform.
On the Message Push Settings page in the IoT Platform console, configure the Xiaomi AppSecret.
FCM (Google migrated GCM push to Firebase and renamed it FCM)
NoteBefore you start, make sure that Google Play Services is installed on the mobile phone. Otherwise, the registration will fail. Most mobile phones in mainland China do not have Google services.
Request and download the FCM service account private key file.
Create a project on the FCM push platform and add an app to the project.
Download the google-services.json file for the app. From the JSON file, retrieve the values of project_number and mobilesdk_app_id. Record them as sendId (used for SDK initialization) and applicationId (used for registration), respectively.

In the Firebase console, go to Settings > Service accounts.
NoteFor more information about this process, see https://firebase.google.com/docs/cloud-messaging/migrate-v1?hl=zh&authuser=0#provide-credentials-manually.
Click Generate new private key, and then click Generate Key to confirm.
Securely store the JSON file that contains the key.
Enter the FCM key into the IoT Platform.
Open the downloaded JSON file in a text editor.
Go to the IoT Platform. Copy the entire JSON content of the file and paste it into the GCM/FCM Server Key text box for the Production environment, as shown in the following figure.
The field may appear empty after you save. This is expected. Test whether a push can be sent successfully.
OPPO
List your app on the OPPO marketplace. The app must have a rating of A to use the push service. For details about this policy, contact OPPO customer service.
Register an OPPO enterprise developer account on the OPPO Open Platform to obtain an AppKey and MasterSecret.
Add your application and enable the OPPO push service on the OPPO Open Platform.
On the Message Push Settings page in the IoT Platform console, set your OppoAppkey and OppoMasterSecret.
VIVO
NoteVIVO push notifications are not currently supported in white-label apps on the Alibaba Cloud International site.
Register a VIVO account and create an application on the VIVO Open Platform. You must use an enterprise developer account. After approval, you will receive an AppID, AppKey, and AppSecret for your application.
On the Message Push Settings page in the IoT Platform console, set the AppID, AppKey, and AppSecret for your VIVO application.
Develop application push
Refer to the following SDKs to develop the mobile application push feature.
Android: For more information, see Mobile Application Push SDK.
iOS: For more information, see Mobile Application Push SDK.
Pushable messages
The SDK provided by the IoT Platform supports the following two types of messages.
Device alert messages
You can configure alert messages in the console. When a device triggers an alert rule, a message is automatically pushed to the app.
Push scope: All users of the device, including the device administrator and users with whom the device is shared.
Configuration method: Configure device alert information under Device Alerting on the Human-Computer Interaction page of the platform. For more information, see Configure device alerting.
Device sharing messages
When the device administrator (ownerName, referred to as User A in the examples) shares the device with another user (memberName, referred to as User B in the examples), the platform automatically pushes a device sharing message to the app user.
ownerName: Device owner alias (for example, a username)
memberName: Shared user (or non-owner) alias (for example, a username)
There are six types of device sharing messages. The following table provides examples of messages received during the device sharing process.
Message type
Device sharing scenario
Device owner initiates sharing with another user
When User A shares a device with User B, User B receives the message:
ownerName + " shared a device with you.".Device owner cancels sharing
When User A cancels sharing with User B, User B receives the message:
ownerName + " canceled device sharing.".Shared user accepts the share request
When User B accepts the share request from User A, User A receives the message:
memberName + " added your device.".Shared user rejects the share request
When User B rejects the share request from User A, User A receives the message:
memberName + " canceled device sharing.".Device is preempted
When User B preempts User A's device, User A receives the message:
memberName + " preempted your device.".The initiator is detached.
After User B accepts the shared device from User A, if User A detaches the device, User B receives the message:
ownerName + " removed your device.".NoteFor Android applications, only the "Device owner initiates sharing with another user" message supports both offline and online push. All other device sharing messages support only online push.

