ドキュメントに従ってすべてを正常に実装し、デバイスを pushwoosh に登録しました。
コードは次のとおりです。
<script>
document.addEventListener("deviceready", onDeviceReady, false);
var pushNotification;
function onDeviceReady() {
pushNotification = window.plugins.pushNotification;
pushNotification.register
(successHandler, errorHandler,{"senderID":"10524986381","ecb":"onNotificationGCM"});
}
function onNotificationGCM(e) {
switch( e.event )
{
case 'registered':
if ( e.regid.length > 0 )
{
PushWoosh.appCode = "F653A-0888C";
PushWoosh.register(e.regid, function(data) {
alert("PushWoosh register success: " + JSON.stringify(data));
}, function(errorregistration) {
alert("Couldn't register with PushWoosh" + errorregistration);
});
}
break;
}
}
function successHandler (result) {
}
function errorHandler (error) {
}
</script>
残念ながら、一度送信されたプッシュ通知をデバイスで受信できません。
助けてください、ありがとう!