我已经尝试了各种方式来暗示这里的代码:
我失败了。我在后端启用了它,我尽我所能遵循所有这些指令......我的个人资料在应用程序开发人员门户网站中启用,但对于我的生活我失败了......我想我失败了这里:
function initPushwoosh() {
var pushNotification = window.plugins.pushNotification;
pushNotification.onDeviceReady();
pushNotification.registerDevice({alert:true, badge:true, sound:true, pw_appid:"PUSHWOOSH_APP_ID", appname:"APP_NAME"},
function(status) {
var deviceToken = status['deviceToken'];
console.warn('registerDevice: ' + deviceToken);
},
function(status) {
console.warn('failed to register : ' + JSON.stringify(status));
navigator.notification.alert(JSON.stringify(['failed to register ', status]));
}
);
pushNotification.setApplicationIconBadgeNumber(0);
document.addEventListener('push-notification', function(event) {
var notification = event.notification;
navigator.notification.alert(notification.aps.alert);
pushNotification.setApplicationIconBadgeNumber(0);
});
}
我确保我把它放在我的 index.js 中,并确保我输入了我的应用程序代码和应用程序名称以匹配 pooshwoosh 后端门户,但我仍然失败了......任何网站都会令人惊叹!!!!