Skip to content
This repository was archived by the owner on Sep 4, 2020. It is now read-only.
This repository was archived by the owner on Sep 4, 2020. It is now read-only.

iOS + FCM: Silent notifications require content_available = true #2449

@andreszs

Description

@andreszs

Expected Behaviour

Notifications without the notification field in the payload should be parsed normally, because we are sending data instead.

Actual Behaviour with app in FOREGROUND

The on('notification') event handler is not called when a silent notification is received. Only when adding content_available = true to the payload, the notification will be handled.

Reproduce Scenario (including but not limited to)

iOS with FCM

Steps to Reproduce

Send this payload and it will be ignored:

{
   "to" : "bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1...",
   "data" : {
     "Nick" : "Mario",
     "body" : "great match!",
     "Room" : "PortugalVSDenmark"
   },
 }

Platform and Version (eg. Android 5.0 or iOS 9.2.1)

iOS 11.4

Cordova CLI version and cordova platform version

cordova 7.1.0
cordova-ios 4.5.4

Plugin version

2.2.3

Sample Push Data Payload (that works)

This notification will be handled properly.

{
   "to" : "bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1...",
   "content_available" : true,
   "data" : {
     "Nick" : "Mario",
     "body" : "great match!",
     "Room" : "PortugalVSDenmark"
   },
 }

Suggested Solution

Please update the README to reflect this information because it barely says anything about FCM notifications. Notice that the GCM service is to be shutdown on April 2019.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions