0

您好,我目前正在开发我的 ios pushwoosh phonegapp 应用程序。我正在遵循本指南

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

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);
}); 
4

1 回答 1

0

看看这个 phonegap 集成的工作示例: https ://github.com/shaders/push-notifications-sdk/tree/master/SDK%20Sample%20Projects/iPhone-Phonegap

和这个javascript文件,它显示了你应该在哪里实现提供的代码: https ://github.com/shaders/push-notifications-sdk/blob/master/SDK%20Sample%20Projects/iPhone-Phonegap/www/js/index .js

于 2013-02-25T15:49:55.783 回答