Closed co3k closed 10 years ago
The current implementation of PayloadAlert requires "body", but the alert attribute of payload doesn't require it like the following (this example is from https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ApplePushService.html):
{ "aps" : { "alert" : { "loc-key" : "GAME_PLAY_REQUEST_FORMAT", "loc-args" : [ "Jenna", "Frank"] }, "sound" : "chime" }, "acme" : "foo" }
We can pass None to "body" of course but it uses wasteful bytes of payload. It is not good since the payload has length limitation.
My patch allows empty PayloadAlert as a result. Maybe it should be denied (by raising exceptions). Any comments?
:+1:
The current implementation of PayloadAlert requires "body", but the alert attribute of payload doesn't require it like the following (this example is from https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ApplePushService.html):
We can pass None to "body" of course but it uses wasteful bytes of payload. It is not good since the payload has length limitation.