Skip to content

Push notification not shown when iOS app is closed/killed #790

@plastic-kartik

Description

@plastic-kartik

Hello @morganchen12 / Everyone,

I cannot receive the FCM push when the app is closed/killed. I receive the notifications when the app is in foreground or background, but I also want to receive like how whatsapp/facebook notify even when the app is closed.

I can get the notifications in this scenario if i directly publish it from the FCM console, but I can't get the notification when server tries to push.

This is the aps dictionary at the server side:

{
"to":"fcm device token",
"data":
{"title":"Exclusive Offers at CF Masonville Place",
"body":"Look for the 'CF NOW Zone' signs across the mall ...",
"sound":"default",
"click_action":"Launch"
},
"notification":
{"title":"Exclusive Offers at CF Masonville Place",
"body":"Look for the 'CF NOW Zone' signs across the mall ...",
"sound":"default",
"click_action":"Launch"
},
"content_available":true,
"priority":"high",
}

Also, want to point out that I receive a push notification when publishing from the firebase console with "content_available" key set to true.(Also works without the key from the console)

Any help would be greatly appreciated. Thanks

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