我已根据文档成功实施了所有内容,并使用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>
但遗憾的是,一旦发送,我无法在设备上收到PushNotifications。
请帮助,谢谢!