make PayloadAlert body parameter optional since loc_key can be provided instead#30
make PayloadAlert body parameter optional since loc_key can be provided instead#30derekspelledcorrectly wants to merge 1 commit intodjacobs:masterfrom
Conversation
body and loc_key are mutually exclusive and body should be optional if loc_key is provided, otherwise the empty body takes up payload space which is already so constrained with APNs.
|
I'm not sure I agree - body & loc-key are included in our message notifications. The body is the basic message, and the loc_key is used for the swipe language. I may be misunderstanding what you mean. Additionally, this pathc fails Travis - do you know why (I haven't had a chance to look). Thanks, |
|
My experience has been that loc-key overrides body, and there's no point in providing both, but I could be missing something there. My patch is overzealous if there is a reason to provide both. In any case, body should absolutely be optional, as you don't need it if you provide a loc-key. I don't use body at all. However, I've since noticed that making body optional was already proposed in adamrimon/PyAPNs@bc90e05 and covered in #21 and #23, so I'm closing this. |
|
Right - loc-key definitely doesn't override body in all cases, we use both all the time. Thanks. |
|
Just out of curiosity, can you explain how you use both? When I provide both, it seems that the user only ever sees the localized string from loc-key. Do you pass data in the body that's not visible to the user? Or is there a context in which the user sees the body instead of the localized string? |
|
Sure - drop me a note at david@29.io and I'll send you an example. On Thu, Feb 7, 2013 at 6:22 PM, Derek notifications@github.com wrote:
(646) 244 9910 |
body and loc_key are mutually exclusive and body should be optional if loc_key is provided, otherwise the empty body takes up payload space which is already so constrained with APNs.