我已经测试过使用cordova-1.8.1.js发送推送通知和推送插件以及pushwoosh.com,它可以正常工作.我按照这个教程:http://www.pushwoosh.com/programming-push-notification/push-notification-sdk-integration-for-phonegap/
推送通知发送到我的iPhone,它播放声音,并在手机和应用程序关闭时显示通知,好!但是,如果我在通知可见时打开手机,那么应用程序将按原样打开...但显示的警告是:警告"推送通知","{\ aps \":\ sound \": \"默认\",\"警告\":\"然后消息.... \"}}"
此外,如果我用主页按钮删除应用程序并再次启动它,我会收到另一个提示"registerDevice","type":"7".....等等.2.我怎么能让它消失?
任何输入都是指定的,谢谢!
问题解决了.使用此选项,它只会在警报中显示消息,而不显示任何其他信息.
document.addEventListener('push-notification', function(event) {
//console.warn('push-notification!: ' + event.notification);
//navigator.notification.alert(JSON.stringify(['push-notification1!', event.notification]));
var notification = JSON.parse(event.notification);
navigator.notification.alert(notification.aps.alert);
//pushNotification.setApplicationIconBadgeNumber(0);
pushNotification.setApplicationIconBadgeNumber(0);
});
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
11578 次 |
最近记录: |