Hi,

We've recently upgraded from PushWoosh 4.2.2 to PushWoosh 6.2.0 and have found different behaviour (or a bug) in the two different versions of the plugin on IOS. Our app has been out for over a year and this is the first time we have wanted to upgrade all our plugins. Until now its been very reliable.

Short Summary

PushWoosh behaviour on 4.2.2

Our server sends a content-available=1 (a slient push) to our app.

If our app is in the foreground, the silent push event is captured and a function call is made to our JavaScript function "HandlePushWooshIOSNotification". We process this in our app.

If our app is in the background, he silent push event is captured and a function call is made to our JavaScript function "HandlePushWooshIOSNotification".We process this in our app.

This is the expected behaviour and we can see that it works as expected. This code has been running for around 18 months for us.

PushWoosh behaviour on 6.2.0

Our server sends a content-available=1 (a slient push) to our app.

If our app is in the foreground, the silent push event is captured and a function call is made to our JavaScript function "HandlePushWooshIOSNotification". We process this in our app.

If our app is in the background, we can see that the event has been captured by the PushWoosh plugin (logs below), but our JavaScript function "HandlePushWooshIOSNotification" is never called and no error is logged (as far as we can see). This is the problem.

We know that a number of changes were made to the PushWoosh plugin between these two versions, e.g. the data format has changed, the deviceToken has changed to from deviceToken to pushToken, but as far as we can see the method to handle events,

document.addEventListener('push-notification', HandlePushWooshIOSNotification);

has not changed. We've managed the data format changes easily, since we can see that our HandlePushWooshIOSNotification is called when in the foreground we can see the correct data formats being passed in. We never even get the call to HandlePushWooshIOSNotification when in the background.

We test the background functionality immediately we put the app in the background. We know that if the app goes in the background for more than 15 mins, it can get suspended. We also handle this but in a different way on our server rather than the client.

Long summary

We can see from the logs when our function HandlePushWooshIOSNotification gets called. So long as our function is called, we can handle it and its problem. PushWoosh does not seem to call the function.

Cordova Plugin 4.2.2 Foreground

This works correctly and we can see HandlePushWooshIOSNotification called

2016-09-12 09:39:11.619 Jambuster[3126:358402] ================ 2016-09-12 09:39:11.620 Jambuster[3126:358402] ===== HandlePushWooshIOSNotification: event = {"notification":{"aps":{"content-available":1},"p":"1j","onStart":false}} 2016-09-12 09:39:11.620 Jambuster[3126:358402] ================ 2016-09-12 09:39:11.672 Jambuster[3126:359243] [PW] [I] -[PWRequestManager sendRequestInternal:withDict:error:] x | Pushwoosh request: | Url: https://cp.pushwoosh.com/json/1.3/pushStat | Payload: {"request":{"device_type":1,"hash":"1j","application":"A2EE0-23D28","userId":"USERID_CHANGED_TO_PROTECT_THE_INNOCENT","v":"3.1.1.434","hwid":"USERID_CHANGED_TO_PROTECT_THE_INNOCENT"}} | Status: "200 no error" | Response: {"status_code":200,"status_message":"OK","response":null} x 2016-09-12 09:39:11.675 Jambuster[3126:359243] [PW] [D] -[PushNotificationManager sendStatsBackground:] sendStats completed 2016-09-12 09:39:11.687 Jambuster[3126:359248] [PW] [I] -[PWRequestManager sendRequestInternal:withDict:error:] x | Pushwoosh request: | Url: https://cp.pushwoosh.com/json/1.3/setBadge | Payload: {"request":{"device_type":1,"badge":0,"application":"A2EE0-23D28","userId":"USERID_CHANGED_TO_PROTECT_THE_INNOCENT","v":"3.1.1.434","hwid":"USERID_CHANGED_TO_PROTECT_THE_INNOCENT"}} | Status: "200 no error" | Response: {"status_code":200,"status_message":"OK","response":null} x 2016-09-12 09:39:11.689 Jambuster[3126:359248] [PW] [D] -[PushNotificationManager sendBadgesBackground:] setBadges completed

Cordova Plugin 4.2.2 Background

This works correctly and we can see HandlePushWooshIOSNotification called

2016-09-12 09:36:03.209 Jambuster[3126:358578] [PW] [I] -[PWRequestManager sendRequestInternal:withDict:error:] x | Pushwoosh request: | Url: https://cp.pushwoosh.com/json/1.3/pushStat | Payload: {"request":{"device_type":1,"hash":"1u","application":"A2EE0-23D28","userId":"USERID_CHANGED_TO_PROTECT_THE_INNOCENT","v":"3.1.1.434","hwid":"USERID_CHANGED_TO_PROTECT_THE_INNOCENT"}} | Status: "200 no error" | Response: {"status_code":200,"status_message":"OK","response":null} x 2016-09-12 09:36:03.211 Jambuster[3126:358578] [PW] [D] -[PushNotificationManager sendStatsBackground:] sendStats completed 2016-09-12 09:36:03.263 Jambuster[3126:358581] [PW] [I] -[PWRequestManager sendRequestInternal:withDict:error:] x | Pushwoosh request: | Url: https://cp.pushwoosh.com/json/1.3/setBadge | Payload: {"request":{"device_type":1,"badge":0,"application":"A2EE0-23D28","userId":"USERID_CHANGED_TO_PROTECT_THE_INNOCENT","v":"3.1.1.434","hwid":"USERID_CHANGED_TO_PROTECT_THE_INNOCENT"}} | Status: "200 no error" | Response: {"status_code":200,"status_message":"OK","response":null} x 2016-09-12 09:36:03.264 Jambuster[3126:358581] [PW] [D] -[PushNotificationManager sendBadgesBackground:] setBadges completed 2016-09-12 09:36:03.277 Jambuster[3126:358402] ================ 2016-09-12 09:36:03.278 Jambuster[3126:358402] ===== HandlePushWooshIOSNotification: event = {"notification":{"aps":{"content-available":1},"p":"1u","onStart":false}} 2016-09-12 09:36:03.279 Jambuster[3126:358402] ================

Cordova Plugin 6.2.0 Foreground

This works correctly and we can see HandlePushWooshIOSNotification called

2016-09-12 09:42:09.242 Jambuster[3141:359949] [PW] [D] -[PushNotification onPushAccepted:withNotification:onStart:] Notification opened: { foreground = 1; ios = { aps = { "content-available" = 1; }; p = "1m"; }; onStart = 0; } 2016-09-12 09:42:09.249 Jambuster[3141:359949] ================ 2016-09-12 09:42:09.249 Jambuster[3141:359949] ===== HandlePushWooshIOSNotification: event = {"notification":{"onStart":false,"foreground":true,"ios":{"aps":{"content-available":1},"p":"1m"}}} 2016-09-12 09:42:09.250 Jambuster[3141:359949] ================ 2016-09-12 09:42:09.250 Jambuster[3141:359949] HandlePushWooshIOSNotification: got silent notification 2016-09-12 09:42:09.250 Jambuster[3141:359949] ===== 2016-09-12 09:42:09.250 Jambuster[3141:359949] HandleNotificationEvent: event 2016-09-12T09:42:09Z -> {"contentAvailable":true,"isActive":true,"originalPushWooshEvent":{"onStart":false,"foreground":true,"ios":{"aps":{"content-available":1},"p":"1*m"}}} 2016-09-12 09:42:09.250 Jambuster[3141:359949] ===== 2016-09-12 09:42:09.250 Jambuster[3141:359949] HandleNotificationEvent: adding GetNotificationsFromServer to Execution queue

Cordova Plugin 6.2.0 Background

This is where we expect to see our function HandlePushWooshIOSNotification called. We can see that the PooshWoosh plugin captures the silent notification, but it just disappears and nothing else happens.

2016-09-12 09:30:08.677 Jambuster[3106:356563] [PW] [D] -[PushNotification] Notification opened: { foreground = 0; ios = { aps = { "content-available" = 1; }; p = "1h"; }; onStart = 0; } 2016-09-12 09:30:08.741 Jambuster[3106:356843] [PW] [I] -[PWRequestManager] x | Pushwoosh request: | Url: https://cp.pushwoosh.com/json/1.3/pushStat | Payload: {"request":{"device_type":1,"hash":"1h","application":"A2EE0-23D28","userId":"USERID_CHANGED_TO_PROTECT_THE_INNOCENT","v":"4.0.4.","hwid":"USERID_CHANGED_TO_PROTECT_THE_INNOCENT"}} | Status: "200 no error" | Response: {"status_code":200,"status_message":"OK","response":null} x 2016-09-12 09:30:08.743 Jambuster[3106:356843] [PW] [D] -[PushNotificationManager] sendStats completed

We aren't clear if this is bug in the PooshWoosh plugin, but we've spent the last few days trying to work it out and can't see what we are doing wrong.

We are using ioS 8.4 on our phone. Thats deliberate as some of our customers haven't upgraded.

Any help or guidance gratefully received, even if its to say we've done something stupid.

Thanks

Rob

asked 12 Sep '16, 09:29
rwillett's gravatar image

rwillett
2015

edited 12 Sep '16, 09:34

Be the first one to answer this question!
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:

×190
×39
×14

question asked: 12 Sep '16, 09:29

question was seen: 403 times

last updated: 12 Sep '16, 09:34