我很乐意将此软件组合用于一些简单的推送通知。
发送和接收不是问题-做到了!
但是我如何才能将iOS上的jQueryMobile应用程序通知它是由PushNotification启动的,而不是显示主屏幕,而是显示另一个与通知相关的屏幕呢?
最佳答案
Notification
对象具有applicationLaunchNotification
属性,如果通过通知启动应用程序,则该属性的值为1
。
下面的方法在应用程序启动时查询挂起的通知:
window.plugins.pushNotification.getPendingNotifications(function(notifications) {
if(notifications.length > 0){
var note = notifications[0];
if(note.applicationLaunchNotification == "1"){
// do the processing
}
}
});
详细信息-https://github.com/phonegap/phonegap-plugins/tree/master/iOS/PushNotification
关于ios - Phonegap + jQueryMobile + iOS上的PushNotifications,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11492030/