phonegap-build/PushPlugin — pull request #290 by aaronyo (2014-08-19 16:37:17+00:00)
Title: use NSJSONSerialization; only quote string props

This fix was created using the code @mrsubtle posted in #221.

More discussion can be found on that issue, but the gist of it is:

* No longer fails on arrays
* Uses NSJSONSerialization to correctly encode the notification as JSON
* breaking change: Number and Boolean types will now come through as Numbers and Booleans rather than Strings -- they are not quoted in the json
* breaking change: This includes the 'foreground' parameter which is added by the plugin -- it's a Number now

The breaks seems worth it to me as proper encoding of the notification's properties seems fundamental.

I also would be in favor of passing a second argument to onNotificationAPN, `{foreground: }`, instead of sticking it unexpectedly into the *otherwise* user specified notification body. Happy to make another pull request for that change if others want it.