使用Jpush-react-native,在android上调用时,本地通知不显示横幅,仅振动并添加到通知中心。 (Android的默认优先级)。 https://github.com/jpush/jpush-react-native
https://developer.android.com/training/notify-user/channels#importance
OS:Mac OS Mojave 反应本色0.59.1 jpush-react-native:2.6.6 经过测试:Huawei nova 2i,mi 9 se
如何提升本地通知的优先级?
我从Aurora文档中可以看到 ” JPushInterface.EXTRA_NOTI_PRIORITY 支持SDK 3.0.0或更高版本,并支持rom 16或更高版本。 当默认值为0且范围是-2到2时,其他值将被忽略并默认。 通知优先级
Bundle bundle = intent.getExtras();
String prio = bundle.getString(JPushInterface.EXTRA_NOTI_PRIORITY);
https://docs.jiguang.cn/en/jpush/client/Android/android_api/ “
我尝试将优先级添加到额外部分中,但没有成功。
JPush.addLocalNotification({
messageID: "123456789",
title: "testMe",
content: "messageValue",
extras: { priority: '2' }
})
注意:我可以通过设置启用浮动通知来触发横幅。但是使用其他库,我能够触发本地通知横幅,而无需让用户修改其设置。
谢谢!