Skip to content Skip to sidebar Skip to footer

Android Push Notifications Not Being Received When App Closed

I followed the example in the PushSharp repository at: PushSharp Android Client Sample Everything is working great if the app is open or in the background (by hitting home or back

Solution 1:

Did you tried it with debug, or release mode? I experienced the same when I started my app in Debug mode.

Solution 2:

So, turns out that some Android devices battery or protected Apps settings causes the notification not to display. For example, in Huawei EMUI devices going to "Protected apps" settings and turning on the protected switch enables the app to receive push notification even after the app is terminated.

Solution 3:

This behavior might be device specific. I experienced the same with Huawei devices using EMUI. Could solve it by adjusting the battery saving settings.

See this question: Remote Push Notifications and terminated Apps

Solution 4:

If you want your service to keep running even if the application is killed then you should add the following in the service tag in your AndroidManifest.xml file.

android:stopWithTask="false"

OR

If you are using GCM for push notification and want to run the service when the notification arrives then you have to register your service as the GCM receiver in your AndroidManifest.xml file. You can do this by adding the following code

<serviceandroid:name=".yourPushService"android:exported="false"><intent-filter><actionandroid:name="com.google.android.c2dm.intent.RECEIVE" /></intent-filter></service>

Post a Comment for "Android Push Notifications Not Being Received When App Closed"