Skip to content

Parse.Push not silent with push_type="background" on ios #6369

Open
@taivo

Description

@taivo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions