chemerisuk / cordova-plugin-firebase-messaging

Cordova plugin for Firebase Cloud Messaging

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

iOS onBackgroundMessage never gets fired

mariosteinbacher opened this issue · comments

Hello!

on iOS onBackgroundMessage never gets fired, always onMessage gets called.
When the app is in background or not even running the app starts/opens and then onMessage gets called.

content_available: true (according google documentation: https://firebase.google.com/docs/cloud-messaging/http-server-ref) is set on the payload (not in property notification.content-available) at handover to firebase.
if content_available is not set nothing happens on iOS no push is arriving at all.

best regards

@mariosteinbacher I'd suggest you to read https://firebase.google.com/docs/cloud-messaging/concept-options carefully in order to understand how FCM messages work. content_available is not the only thing that affects message delivery.

OK @chemerisuk, I got you, but this should be documented as an "OS feature" in this case.
Am I wrong?

commented

I had the same issues @mariosteinbacher and ended-up changing content-available: 1 to content_available: true.
It now works. I've created a PR to fix the documentation.