parse-community / parse-community/parse-server
Parse.Push not silent with push_type="background" on ios
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 21.4k
- Forks
- 4.8k
- Avg merge
- 7h 45m
- Merged PRs (30d)
- 11
Description
Issue Description
The issue I encountered can be replicated by using the Push functionality of Parse Dashboard. I'm using parse-server 3.9 on Back4App. The behavior I'm looking for is a silent push that does not trigger a notification on iOS when the app is in the background (or not running), but still receive the payload content to do my own processing when the app is running in the foreground.
Steps to reproduce
Use the Parse Dashboard's json push functionality with the following payload:
{
"title":"2",
"content-available":1,
"push_type":"background",
"priority":5,
"custom": {"field1": "foo"}
}
When monitoring my phone via Xcode, I can see the following payload being received:
{"subtitle":"","title":"2","body":"","badge":1,"data":{"custom":{"field1":"foo"},"aps":{"alert":{"title":"2"},"content-available":1},"push_type":"background","priority":5},"id":"-------------"}
However, because of the "alert" field in the aps dictionary, this push will not be silent when the app is in the background or not running. If we remove the "title" field in the Json payload from Parse Dashboard, the notification does not reach my phone/Xcode, so i'm not able to do custom processing on it while the app is running.
Note that in the received payload, the "push_type" field is outside of the "aps" dictionary instead of inside it. I'm suspecting this may be the issue but currently do not have the right setup to perform a trace/debug.
Is there a way to work around this issue? Right now I'm settling for using a badge updates but true silent notification would be much better. I'm using Back4app and have tried both parse-server 3.9.0 and 3.10 beta, which is the latest available there.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the Parse Dashboard JSON payload and monitor the received notification in Xcode. Compare the background push behavior with and without the title field; done means the payload reaches the app for foreground processing without displaying an alert when the app is backgrounded or not running.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, javascript, node.js
- Domain
- api, backend, mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100