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

Don't set "aps" key if no well-known properties are present #141

Closed
aaronpk opened this issue Dec 5, 2013 · 5 comments
Closed

Don't set "aps" key if no well-known properties are present #141

aaronpk opened this issue Dec 5, 2013 · 5 comments

Comments

@aaronpk
Copy link

aaronpk commented Dec 5, 2013

It is possible and entirely valid to send a push notification through APNS containing just the payload {"hello":"world"}. This should arrive in the app's delegate method exactly as was sent (assuming the app is in the foreground when the notification is sent).

Currently the library always adds the aps key even if none of the alert, badge, etc keys are set. Instead, the aps key should only be set if at least one of the well-known properties are present.

@argon
Copy link
Collaborator

argon commented Dec 5, 2013

You're right, however it didn't seem to me like there is an obvious use case for sending notifications which don't have an aps property - they can only be consumed when the app is running, and from my experience they're not designed for communication with a running app, the fact that it works is for convenience more than anything.

I'll take a look though and if I can see an obvious way to implement it I will.

-A

On 5 Dec 2013, at 20:01, Aaron Parecki notifications@github.com wrote:

It is possible and entirely valid to send a push notification through APNS containing just the payload {"hello":"world"}. This should arrive in the app's delegate method exactly as was sent (assuming the app is in the foreground when the notification is sent).

Currently the library always adds the aps key even if none of the alert, badge, etc keys are set. Instead, the aps key should only be set if at least one of the well-known properties are present.


Reply to this email directly or view it on GitHub.

@aaronpk
Copy link
Author

aaronpk commented Dec 5, 2013

Cool, thanks!

@argon
Copy link
Collaborator

argon commented Dec 19, 2013

I've been very busy recently, will try to get something going over the Holidays.

@argon
Copy link
Collaborator

argon commented Jan 13, 2014

I see this behaviour is desirable when MDM is used. My apologies. I have developed a fix which will be in the next version.

@argon argon closed this as completed in 3c5b79d Jan 13, 2014
argon added a commit that referenced this issue Jan 13, 2014
Credit: Romain Goyet (Ecco)
@aaronpk
Copy link
Author

aaronpk commented Jan 13, 2014

Thanks!

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

No branches or pull requests

2 participants