Push Notification Empty Custom Data (iOS 8)

I have an application that uses custom data in remote push notifications.

I can see the details of the custom data in my AppDelegate’s didReceiveRemoteNotification:

{ aps = { alert = "Test"; badge = 1; sound = "sound.wav"; }; p = "\>,"; u = "{\"messageId\":\"756\"}"; }

But, when my Corona notification listener gets the event, the “custom” table is empty.

I’m not doing anything custom with the notification in Obj-C. (I only added didReceiveRemoteNotification to debug this problem.) I’m not certain it’s iOS 8 related, but the code did work a week ago, and currently does not.

Any help is appreciated! Thanks in advance,

Ben

Can you file a bug report on this please?  Make sure to put iOS 8 in the subject. 

Thanks

Rob

Thanks, Rob. I filed a bug yesterday (Case 35948). Is there any way to track its progress? I’d like to know ASAP if there’s something I can/should do to fix this problem on my end, or if I should wait for a fix from you guys.

Thanks!
Ben

I don’t know if this will help you or not, but this thread seems to have a work around:

http://forums.coronalabs.com/topic/51264-registerforremotenotificationtypes-is-not-supported-in-ios-80-and-later/

I know Engineering is working on our fix now.

Rob

Thanks Rob! I’ll hold out a little longer, but it’s good to know that’s an option if I need to take it.

Ben

There were push notifications in today’s daily build though not your specific bug.  Can you give it a try and see if it was covered in the same fix?

Rob

Hi Rob. I finally got it. It was related to the way PushWoosh was structuring the custom data. So, not iOS 8.

Found the answer here: http://forums.coronalabs.com/topic/48026-unable-to-send-custom-data-to-ios-2014/

I had moved my outgoing call to PushWoosh’s API from Parse Cloud Code to PHP. I structured the request the same (“data” vs “ios_root_params.custom”), but it seemed to work differently. Strange. Still not sure why, but at least it’s working now!

Thanks for your help, can you close the bug I filed earlier? (Case 35948)

Thanks,

Ben

Will do.  Glad you solved it.

Rob

For future reference, remote notifications coming in to Corona on iOS need to be structured like this:

{ aps = { alert = "Test"; badge = 1; sound = "sound.wav"; }; custom = { messageId = 756; }; p = "\>l"; }

not like

{ aps = { alert = "Test"; badge = 1; sound = "sound.wav"; }; p = "\>,"; u = "{\"messageId\":\"756\"}"; }

if you want to your Corona code to see the custom data.

Can you file a bug report on this please?  Make sure to put iOS 8 in the subject. 

Thanks

Rob

Thanks, Rob. I filed a bug yesterday (Case 35948). Is there any way to track its progress? I’d like to know ASAP if there’s something I can/should do to fix this problem on my end, or if I should wait for a fix from you guys.

Thanks!
Ben

I don’t know if this will help you or not, but this thread seems to have a work around:

http://forums.coronalabs.com/topic/51264-registerforremotenotificationtypes-is-not-supported-in-ios-80-and-later/

I know Engineering is working on our fix now.

Rob

Thanks Rob! I’ll hold out a little longer, but it’s good to know that’s an option if I need to take it.

Ben

There were push notifications in today’s daily build though not your specific bug.  Can you give it a try and see if it was covered in the same fix?

Rob

Hi Rob. I finally got it. It was related to the way PushWoosh was structuring the custom data. So, not iOS 8.

Found the answer here: http://forums.coronalabs.com/topic/48026-unable-to-send-custom-data-to-ios-2014/

I had moved my outgoing call to PushWoosh’s API from Parse Cloud Code to PHP. I structured the request the same (“data” vs “ios_root_params.custom”), but it seemed to work differently. Strange. Still not sure why, but at least it’s working now!

Thanks for your help, can you close the bug I filed earlier? (Case 35948)

Thanks,

Ben

Will do.  Glad you solved it.

Rob

For future reference, remote notifications coming in to Corona on iOS need to be structured like this:

{ aps = { alert = "Test"; badge = 1; sound = "sound.wav"; }; custom = { messageId = 756; }; p = "\>l"; }

not like

{ aps = { alert = "Test"; badge = 1; sound = "sound.wav"; }; p = "\>,"; u = "{\"messageId\":\"756\"}"; }

if you want to your Corona code to see the custom data.