w250697116 / apns-sharp

Automatically exported from code.google.com/p/apns-sharp
0 stars 0 forks source link

Custom keys with single values result in extra commas #1

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
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.

Original issue reported on code.google.com by goo...@sfko.com on 16 Jul 2009 at 10:00

GoogleCodeExporter commented 8 years ago
Great, thanks for this too.  I will fix this for the next release shortly.

Original comment by jond...@gmail.com on 17 Jul 2009 at 2:32

GoogleCodeExporter commented 8 years ago

Original comment by jond...@gmail.com on 17 Jul 2009 at 2:35

GoogleCodeExporter commented 8 years ago
I 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.

Original comment by jond...@gmail.com on 17 Jul 2009 at 1:55

GoogleCodeExporter commented 8 years ago
This should be fixed although the api for building notifications is 
significantly
different.

Original comment by jond...@gmail.com on 22 Dec 2009 at 7:58