Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function initPushwoosh() {
- if(typeof cordova !== "undefined"){
- var pushwoosh = cordova.require("pushwoosh-cordova-plugin.PushNotification");
- console.log('initPushwoosh');
- // Should be called before pushwoosh.onDeviceReady
- document.addEventListener('push-notification', function(event) {
- var notification = event.notification;
- // handle push open here
- console.log("push-notification event");
- });
- // Initialize Pushwoosh. This will trigger all pending push notifications on start.
- pushwoosh.onDeviceReady({
- appid: "52F57-AB146"
- });
- pushwoosh.registerDevice(
- function(status) {
- console.log('registerDevice');
- var pushToken = status.pushToken;
- console.log(pushToken);
- },
- function(status) {
- console.log('registerDeviceError');
- console.log(status);
- }
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement