Pushwoosh IOS phonegapp代码集成

时间:2013-02-13 12:44:29

标签: ios phonegap-plugins

您好我正在使用我的ios pushwoosh phonegapp应用程序。我正在关注此guide

我不知道我需要在哪里实现此代码:

In your onDeviceReady function add:
initPushwoosh();

bind: function() {
document.addEventListener('deviceready', this.deviceready, false);
},
deviceready: function() {
// note that this is an event handler so the scope is that of the event
// so we need to call app.report(), and not this.report()
initPushwoosh();

app.report('deviceready');
},

而且这个代码我需要放在同一个文件中吗? 接收推送通知。请参阅initPushwoosh函数中的以下代码片段

document.addEventListener('push-notification', function(event) {
var notification = event.notification;
navigator.notification.alert(notification.aps.alert);
pushNotification.setApplicationIconBadgeNumber(0);
}); 

1 个答案:

答案 0 :(得分:0)