In Notification.BuildPayload(), lines 180-188 of Notification.cs, if the custom key's value array has only a single element, that value will be appended to the payload string, followed by two commas. The first is part of the append operations on lines 183/185, and the second is the trailing comma added on line 188. This causes the payload to be invalid JSON, and the APNS to refuse the notification.
Easiest solution is to remove the commas from lines 183 and 185.
Comment #1
Posted on Jul 17, 2009 by Happy LionGreat, thanks for this too. I will fix this for the next release shortly.
Comment #2
Posted on Jul 17, 2009 by Happy Lion(No comment was entered for this change.)
Comment #3
Posted on Jul 17, 2009 by Happy LionI fixed this issue, as well as a few other problems with the payload generation. I'll admit in refactoring my code, my original 'proven' code did not include the ability to do complex Alert's in the notifications (just supported "alert":"message here"), so adding support for complex alerts, as well as custom notification keys was not thoroughly tested in the 1.0.0.0. The changes I've made in r9 should substantially improve the payload generation. There was another issue with Custom keys in that they were generated inside the APS object, which is not to specification.
Comment #4
Posted on Dec 22, 2009 by Happy LionThis should be fixed although the api for building notifications is significantly different.
Status: Fixed
Labels:
Type-Defect
Priority-Medium
Milestone-1.0.1.0
r9