1

The problem scenario

A developer calls the API interface to push a message, and the request returns: {"code": "80000000","msg": "Success","requestId": "16233092 * *287602020201"}. Returning "code": "80000000" indicates that the request was successful, but the mobile phone did not receive the notification bar message.

2. Cause analysis and investigation

First, you can check whether the following fields are used improperly in the message body:

Case 1: The value of validate_only is true

The validate_only field controls whether the current message is a test message. The test message is only for format validity verification and will not be pushed to the user device. That is to say, when the value of validate_only is true, even if the request returns "code": "80000000", the server will not push the message to the client side.

Case 2: Not using the notification field

There is message.data in the message body, no message.notification and message.android.notification, and the message type is a transparent message. The message is transparently transmitted to the application and will not be displayed in the notification bar.

Case 3: The value of foreground_show is false

foreground_show controls the notification processing of the foreground application. When the value is set to "false" and the application is in the foreground, the entire content of the notification message will be passed to the application through the onMessageReceived(RemoteMessage message) method, and the notification bar message will not be displayed.

Notification handling reference documentation for foreground applications

If the above three conditions do not meet, you can use the Push self-service analysis function to query the message sending status:

Log in to the AppGallery Connect website, click "My Projects", find your project in the project list, and enter through the "Growth > Push Service > Self-Service Analysis (Beta)" tab.

After entering the "token" when sending the message and the "requestId" returned by the push service, click the query button to view the message sending status.

The update of the above message records is relatively slow. If the message processing is not queried, please check it after half an hour of pushing the request. Push Self-Service Analysis Reference Documentation

If you can't find the cause after following the troubleshooting steps above, please check the technical support documentation.

Learn more details>>

Visit the official website of Huawei Developer Alliance
Get development guidance documents
Huawei Mobile Services Open Source Warehouse Address: GitHub , Gitee

Follow us to know the latest technical information of HMS Core for the first time~


HarmonyOS_SDK
596 声望11.7k 粉丝

HarmonyOS SDK通过将HarmonyOS系统级能力对外开放,支撑开发者高效打造更纯净、更智能、更精致、更易用的鸿蒙应用,和开发者共同成长。