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 に答える