I have this issue with the phonegap plugin. My js:

function initPushwoosh() {
  var pushNotification = window.plugins.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:"1CA3F-88E03"});

  //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);
}

/**
 * We will wait for device ready if we are within cordova.
 * */
if(window.cordova){
  document.addEventListener('deviceready', function() {
    initPushwoosh();
  }, false);
}

Logs:

2014-05-30 16:08:20.881 HelloWorld[57870:60b] Initializing application: (null), (null)
2014-05-30 16:08:21.171 HelloWorld[57870:60b] Multi-tasking -> Device: YES, App: YES
2014-05-30 16:08:21.202 HelloWorld[57870:60b] Unlimited access to network resources
2014-05-30 16:08:21.342 HelloWorld[57870:60b] Will show push notifications alert
2014-05-30 16:08:21.495 HelloWorld[57870:5f07] Sending request: {"request":{"application":"1CA3F-88E03","v":"2.2","hwid":"[uuid]"}}
2014-05-30 16:08:21.497 HelloWorld[57870:5f07] To urL https://cp.pushwoosh.com/json/1.3/applicationOpen
2014-05-30 16:08:22.321 HelloWorld[57870:60b] Resetting plugins due to page load.
2014-05-30 16:08:22.442 HelloWorld[57870:60b] Finished load of: file:///var/mobile/Applications/[uuid]/HelloWorld.app/www/index.html
2014-05-30 16:08:22.472 HelloWorld[57870:9407] Sending request: {"request":{"badge":0,"application":"1CA3F-88E03","v":"2.2","hwid":"[uuid]"}}
2014-05-30 16:08:22.472 HelloWorld[57870:9407] To urL https://cp.pushwoosh.com/json/1.3/setBadge
2014-05-30 16:08:22.477 HelloWorld[57870:9a03] Sending request: {"request":{"hwid":"[uuid]","app_version":"1.0.0","sounds":[],"push_token":"[somehash]","timezone":"28800","language":"en","v":"2.2","application":"1CA3F-88E03","device_type":1,"gateway":"sandbox","package":"co.mediapop.fx1"}}
2014-05-30 16:08:22.478 HelloWorld[57870:9a03] To urL https://cp.pushwoosh.com/json/1.3/registerDevice
2014-05-30 16:08:23.345 HelloWorld[57870:5f07] Response "200 no error": string: {"status_code":200,"status_message":"OK","response":null}
2014-05-30 16:08:23.346 HelloWorld[57870:5f07] sending appOpen completed
2014-05-30 16:08:24.533 HelloWorld[57870:9407] Response "200 no error": string: {"status_code":210,"status_message":"Device not found","response":null}
2014-05-30 16:08:24.534 HelloWorld[57870:9a03] Response "200 no error": string: {"status_code":200,"status_message":"OK","response":null}
2014-05-30 16:08:24.534 HelloWorld[57870:9407] setBadges failed
2014-05-30 16:08:24.534 HelloWorld[57870:9a03] Registered for push notifications: [somehash]

But when I look at the pushWoosh code it says I have 0 subscribers. What can I do?

asked 30 May '14, 08:42
Kit%20Sunde's gravatar image

Kit Sunde
114

Shrug it appears to be working now, I guess it just takes a while.

permanent link
answered 30 May '14, 09:35
Kit%20Sunde's gravatar image

Kit Sunde
114

edited 30 May '14, 09:36

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×326
×165
×76

question asked: 30 May '14, 08:42

question was seen: 1,422 times

last updated: 30 May '14, 09:36