你好,我目前正在开发我的ios pushwoosh手机应用程序。我正在关注这个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);
}); 发布于 2013-02-25 23:49:56
看看这个集成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
https://stackoverflow.com/questions/14853871
复制相似问题