こんにちは、私は現在、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);
});