hms-react-native-plugin icon indicating copy to clipboard operation
hms-react-native-plugin copied to clipboard

setBackgroundMessageHandler method not calling when send message through REST API

Open deepaktringapps opened this issue 2 years ago • 0 comments

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

  • React Native 0.71.3
  • Kit: @hmscore/react-native-hms-push": "6.7.0-300"
  • Device: Huawei p40

@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" ] } }

deepaktringapps avatar Mar 21 '23 11:03 deepaktringapps