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~
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。