[英]cordova phonegap-plugin-push v1.x - how to make it work with Android 8.1 (API level 27)
We use the phonegap-plugin-push in one of our apps and it works really well - up to Android 7 (haven't tested Android 8). 我们在其中一个应用程序中使用了phonegap-plugin-push功能,并且效果非常好-最高支持Android 7(尚未测试Android 8)。
However, Android 8.1 phone don't show notifications 但是,Android 8.1手机不显示通知
we use 我们用
cordova CLI 8.1.2
cordova-android 6.4.0
phonegap-plugin-push 1.10.7
As android platform 6.x does not support API level 27 , we updated to android platform 7.1.1 - no effect 由于Android平台6.x不支持API级别27 ,因此我们更新为android平台7.1.1-无效
Then, we updated to phonegap-plugin-push 1.11.1 - also no effect. 然后,我们更新为phonegap-plugin-push 1.11.1-也无效。
I'd really be glad to hear which versions you are using and if / how you manage get push notifications also on Android 8.1 ... or any other ideas how to make this work? 我真的很高兴听到您使用的是哪个版本,以及是否/如何在Android 8.1上也获得推送通知...或任何其他想法来实现此功能?
Do I need to upgrade to the push plugin v2.x branch? 我需要升级到推送插件v2.x分支吗?
Thanks for any help in advance! 感谢您的任何帮助!
Well, when reading the documentation you understand that the support for channels which is required for Android >= 8 is only supported by the 2.x versions of the phonegap-plugin-push. 好了,在阅读文档时,您了解到Android> = 8所需的通道支持仅受phonegap-plugin-push的2.x版本支持。
In fact, updating wasn't that complicated. 实际上,更新并不是那么复杂。 You need to:
你需要:
Also notice that by now (2.2.3) you have to check for the android platform before calling listChannels() as this there is no dummy implementation for the other platforms (yet). 还要注意,到目前为止(2.2.3),您必须在调用listChannels()之前检查android平台,因为这对于其他平台还没有虚拟实现(尚未)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.