0
A
回答
0
尝试接收时应用程序是在前台,但同时接收应用程序在后台我按照FCM教程方式和实施this plugin。
当设备准备好我会触发此代码:
pushNotification.register(
function (result) {
//Do some stuff
}, function (error) {
//Do some stuff on error
}, {
"badge":"true",
"sound":"true",
"alert":"true",
"ecb": "onNotificationAPN"
});
而且也低于功能实现:
function onNotificationAPN(event) {
if (event) {
if (event.alert) {
alert(Recieved alert: + event.alert);
}
if (event.sound) {
var snd = new Media(event.sound);
snd.play();
}
if (event.badge) {
pushNotification.setApplicationIconBadgeNumber(function() {
//SetApplicationIconBadgeNumber success.
}, function() {
//SetApplicationIconBadgeNumber error.
},
event.badge);
}
}
}
+0
我想离子的代码 –
+0
ohh让我检查 –
+0
请检查我的更新答案,我不擅长离子,但试试这个,让我知道 –
相关问题
- 1. 当应用程序在前台时未收到推送通知
- 2. 当在后台的应用程序接收pushwoosh推送通知
- 3. Worklight:应用程序无法在前台收到推送通知
- 4. 没有收到通知,当应用程序在前台的通知
- 5. 当应用程序在前台运行时收到iOS推送通知
- 6. 当使用IBM Mobilefirst收到推送通知时,如何知道应用程序是在后台还是前台
- 7. FCM - 当应用程序被杀害/在后台,应用会收到通知,但不播放通知声音
- 8. 应用程序崩溃在后台接收推送通知
- 9. 当应用程序从后台转到前台时,忽略推送通知
- 10. iOS版雨燕接收推送通知当应用程序在前台
- 11. iOS上的10推挽没有收到当应用程序在前台
- 12. 当应用程序在后台ngCordova/Ionic推送通知
- 13. 当应用程序在后台时不显示推送通知
- 14. 当应用程序在后台时的Android-Firebase推送通知
- 15. 当应用程序在后台时推送通知
- 16. 应用程序关闭时未收到Android FCM推送通知
- 17. 当应用程序被杀/被刷出时FCM推送通知未收到
- 18. 我在IOS上没有在后台接收fcm推送通知
- 19. 当应用程序处于后台时接收Apple推送通知
- 20. 应用程序不会在后台模式下收到推送通知
- 21. 当收到多个推送通知时,应用程序冻结
- 22. 在前台应用程序未收到GCM通知
- 23. 当应用程序不在后台或前台,不能推送通知到通知管理器
- 24. 未在后台收到Firebase通知或关闭应用程序
- 25. 在收到推送通知后打开应用程序
- 26. 当应用程序在后台时未收到UINotification ios
- 27. android Intent.ACTION_TIME_TICK doent当其他应用程序在后台时收到
- 28. 在接收到前台应用程序和推送通知时刷新当前视图?
- 29. 推送通知消息没有收到应用程序?
- 30. 我的应用程序没有收到解析推送通知
哪个设备你想? –
Android 6.0设备 –