chemerisuk / cordova-plugin-firebase-messaging

Cordova plugin for Firebase Cloud Messaging
MIT License
164 stars 160 forks source link

iOS onBackgroundMessage never gets fired #198

Closed mariosteinbacher closed 2 years ago

mariosteinbacher commented 3 years ago

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

chemerisuk commented 3 years ago

@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.

minduch commented 3 years ago

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

tevla commented 2 years ago

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.