parse-server icon indicating copy to clipboard operation
parse-server copied to clipboard

Push notification - bage increment - changed to uppercase "I"?

Open goggelj opened this issue 10 years ago • 8 comments

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!

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

goggelj avatar Mar 28 '16 11:03 goggelj

It has always been Increment with a capital "I", at least on the iOS side: http://blog.parse.com/announcements/badge-management-for-ios/

UnlikelySassou avatar Mar 28 '16 12:03 UnlikelySassou

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

goggelj avatar Mar 28 '16 12:03 goggelj

Uhm... Interesting, I can add the case for lowercase increment

flovilmart avatar Mar 28 '16 12:03 flovilmart

@drew-gross what should the spec be? I only recall Increment and not the lowercase flavour.

flovilmart avatar Mar 29 '16 02:03 flovilmart

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?.

drew-gross avatar Mar 29 '16 02:03 drew-gross

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.

tanmays avatar Mar 29 '16 07:03 tanmays

Or make it accept both for compatibility with Parse.com and existing Parse Server apps.

drew-gross avatar Mar 29 '16 07:03 drew-gross

I'll make it accept both in a future PR

flovilmart avatar Mar 29 '16 13:03 flovilmart