Push notification - bage increment - changed to uppercase "I"?
In the current parse.com, to increment a badge one uses:
...
"badge: "increment"
...
Just tested with curl and it seems that in the parse-server, to increment badge, I need to send 'Increment' with a capital 'I':
...
"badge: "Increment"
...
A bug/oversight or on purpose? Suggest, at the very least for docs/gist/readme to be updated.
For implementation related questions or technical support, please refer to the Stack Overflow and Server Fault communities.
Make sure these boxes are checked before submitting your issue -- thanks for reporting issues back to Parse Server!
- [y] You've met the prerequisites.
- [y] You're running the latest version of Parse Server.
- [y] You've searched through existing issues. Chances are that your issue has been reported or resolved before.
Environment Setup
Standard heroku deployment (not via button)
Steps to reproduce
curl -X POST
-H "X-Parse-Application-Id: app-id"
-H "X-Parse-Master-Key: master-key"
-H "Content-Type: application/json"
-d '{
"where": {},
"data": {
"alert": "New Alert",
"badge": "increment"
}
}'
https://app.url/parse/push
Logs/Trace
2016-03-28T11:11:20.026577+00:00 app[web.1]: Uncaught internal server error. Invalid value for badge, expected number or 'Increment' undefined
It has always been Increment with a capital "I", at least on the iOS side: http://blog.parse.com/announcements/badge-management-for-ios/
Interesting.
I actually found on your support forum a old post saying it was actually lower case...
My python code has been triggering push for 8 months that way. Never worked with upper case. On 28 Mar 2016 1:04 p.m., "Sassou" [email protected] wrote:
It has always been Increment with a capital "I", at least on the iOS side: http://blog.parse.com/announcements/badge-management-for-ios/
— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/ParsePlatform/parse-server/issues/1223#issuecomment-202356802
Uhm... Interesting, I can add the case for lowercase increment
@drew-gross what should the spec be? I only recall Increment and not the lowercase flavour.
I'm not really the best person to ask about push related stuff, but the docs say capital I, so I'd go with that?.
I was using parse.com hosted cloud code and badge increment was indeed with a capital I. Docs too mention the same. We should retain the original spec.
Or make it accept both for compatibility with Parse.com and existing Parse Server apps.
I'll make it accept both in a future PR