jpush-react-native icon indicating copy to clipboard operation
jpush-react-native copied to clipboard

Banner not showing on local notifications

Open Kuhne1 opened this issue 6 years ago • 0 comments

Local notification does not display banner when called on android, Only vibrates and adds to the notification centre. (The default priority for android). https://developer.android.com/training/notify-user/channels#importance

OS: Mac OS Mojave React-native 0.59.1 jpush-react-native: 2.6.6 Tested on: Huawei nova 2i, mi 9 se

How to escalate the priority of the local notification?

I can see from the Aurora docs that it is possible " JPushInterface.EXTRA_NOTI_PRIORITY Support SDK 3.0.0 or later,and support rom 16 or more. When the default is 0 and the range is -2 to 2 , other values will be ignored and defaulted. Notification priority Bundle bundle = intent.getExtras(); String prio = bundle.getString(JPushInterface.EXTRA_NOTI_PRIORITY); https://docs.jiguang.cn/en/jpush/client/Android/android_api/ "

I have tried to add in the priority into the extra section without success. JPush.addLocalNotification({ messageID: "123456789", title: "testMe", content: "messageValue", extras: { priority: '2' } })

Note: I can trigger the banner by enabling floating notifications through settings. But using other libraries I have been able to trigger the local notification banner without making the user modify their settings.

Thanks!

Kuhne1 avatar Dec 18 '19 02:12 Kuhne1