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

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

Closed
andreszs opened this issue Jun 28, 2018 · 4 comments
Closed

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

andreszs opened this issue Jun 28, 2018 · 4 comments

Comments

@andreszs
Copy link
Contributor

andreszs commented Jun 28, 2018

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.

@macdonst
Copy link
Member

macdonst commented Jul 2, 2018

@andreszs thanks for the heads up and feel free to send a PR to the docs.

@ramon-dejesus
Copy link
Contributor

@andreszs thanks, this fixed my issue, server side!!!

@ramon-dejesus
Copy link
Contributor

@macdonst I added a PR to close this issue up! :)

macdonst pushed a commit that referenced this issue Oct 29, 2018
Creates PR in response to #2449
@lock
Copy link

lock bot commented Nov 28, 2018

This thread has been automatically locked.

@lock lock bot locked as resolved and limited conversation to collaborators Nov 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

3 participants