Redth / PushSharp

A server-side library for sending Push Notifications to iOS (iPhone/iPad APNS), Android (C2DM and GCM - Google Cloud Message), Windows Phone, Windows 8, Amazon, Blackberry, and (soon) FirefoxOS devices!
Other
4.38k stars 1.52k forks source link

Android devices not receiving push notification when the app is killed #887

Open fahadhaq opened 6 years ago

fahadhaq commented 6 years ago

I am using the latest version of PushSharp.

This is only happening on Android phones. I receive notification if the app is open or running on the background but not if the app is killed using the PushSharp code. However if I send a push notification from Firebase Cloud Messaging service I receive the push notification no matter what state the app is in.

Is anyone else having this issue? Could some one please help. Been trying to solve this for the past week.

Thanks in advance

noamo48 commented 5 years ago

That should have nothing to do with PushSharp. Are you maybe somehow unregistering the push notification subscription token each time your app is closed?

ThimonSistemans commented 5 years ago

Android Oreo will not wakeup your 'backgrounded' app when sending messages with 'normal' priority. The priority needs to be set to 'high' when sending 'data' messages. Firebase Cloud Messaging service only sends 'text' messages. 'Text' messages always have a 'high' priority. Firebase docs: https://firebase.google.com/docs/cloud-messaging/concept-options#setting-the-priority-of-a-message

Im not sure if you can set the FireBase messaging priority using PushSharp.