Как я могу реализовать pushwoosh на intel xdk для приложения для Android. Есть ли пошаговое руководство по нему в Интернете. Я поставил ниже код на индексную страницу, я добавил плагин, создал приложение и установил его на свой телефон, но push-уведомления не проходят. Пожалуйста, помогитевнедрение pushwoosh на intel xdk
<script>
function onDeviceReady() {
if(navigator.splashscreen && navigator.splashscreen.hide) { // Cordova API detected
navigator.splashscreen.hide() ;
}
if(window.intel && intel.xdk && intel.xdk.device) { // Intel XDK device API detected, but...
if(intel.xdk.device.hideSplashScreen) // ...hideSplashScreen() is inside the base plugin
intel.xdk.device.hideSplashScreen() ;
}
initPushwoosh();
}
document.addEventListener("deviceready", onDeviceReady, false) ;
function initPushwoosh()
{
var pushNotification = cordova.require("com.pushwoosh.plugins.pushwoosh.PushNotification");
//set push notification callback before we initialize the plugin
document.addEventListener('push-notification', function(event) {
//get the notification payload
var notification = event.notification;
//display alert to the user for example
alert(notification.aps.alert);
//clear the app badge
pushNotification.setApplicationIconBadgeNumber(0);
});
//initialize the plugin
pushNotification.onDeviceReady({pw_appid:"****-****"});
//register for pushes
pushNotification.registerDevice(
function(status) {
var deviceToken = status['deviceToken'];
console.warn('registerDevice: ' + deviceToken);
},
function(status) {
console.warn('failed to register : ' + JSON.stringify(status));
alert(JSON.stringify(['failed to register ', status]));
}
);
//reset badges on app start
pushNotification.setApplicationIconBadgeNumber(0);
}
</script>
извините, он удалил вызовы сценария после того, как я написал шаг 5 выше. В основном используйте теги скриптов для включения файлов 3 js из шага 3. – JVDreamWorker