Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make PayloadAlert body parameter optional since loc_key can be provided instead #30

Closed
wants to merge 1 commit into from

Conversation

derelk
Copy link

@derelk derelk commented Jan 31, 2013

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.

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.
@djacobs
Copy link
Owner

djacobs commented Feb 4, 2013

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,
David

@derelk
Copy link
Author

derelk commented Feb 7, 2013

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.

@derelk derelk closed this Feb 7, 2013
@djacobs
Copy link
Owner

djacobs commented Feb 7, 2013

Right - loc-key definitely doesn't override body in all cases, we use both all the time. Thanks.

@derelk
Copy link
Author

derelk commented Feb 7, 2013

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?

@djacobs
Copy link
Owner

djacobs commented Feb 12, 2013

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:

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?


Reply to this email directly or view it on GitHubhttps://github.com/simonwhitaker/PyAPNs/pull/30#issuecomment-13268270.

(646) 244 9910
http://29.io/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants