HMS-Core / hms-react-native-plugin

This repo contains all of React-Native HMS plugins.
https://developer.huawei.com/consumer/en/doc/overview/HMS-Core-Plugin?ha_source=hms1
Apache License 2.0
235 stars 67 forks source link

setBackgroundMessageHandler method not calling when send message through REST API #270

Open deepaktringapps opened 1 year ago

deepaktringapps commented 1 year ago

Description Description of what the issue is about

Expected behavior In killed/background mode App should receive "setBackgroundMessageHandler".

Current behavior In killed/background mode App receiving notification but "setBackgroundMessageHandler" not calling.

Environment

@ozcanozgur when send notification from pushkit console setBackgroundMessageHandler is called and notification is showing, When we send notification using REST API setBackgroundMessageHandler is not called, But notification alone showing in notification tray. Also notification not coming in foreground of the device.

But when application in foreground everything working as expected

Please find REST API Body:

{ "validate_only": false, "message": { "data": "{"title" : "test","body" : "This is Huawei Notification","image" : "https://www.image.com\"}", "android": { "notification": { "title": "Welcome", "body": "This is Huawei Notification", "image": "https://www.image.com/", "click_action": { "type": 3 }, "foreground_show": false } }, "token": [ "TOKEN" ] } }