CrossGeeks / AzurePushNotificationPlugin

Azure Push Notification Plugin for Xamarin iOS and Android
MIT License
67 stars 34 forks source link

Xamarin Forms Android does not receive notification when app is killed. #21

Closed RickB864 closed 5 years ago

RickB864 commented 5 years ago

Android works well when in foreground or background. Does not receive notification when the app is in the killed state. I have compiled the app in release mode and removed all references to system.diagnostics.debug within my code.

I have the following permissions in Manifest. ` <permission android:name="co.my.packagename.permission.C2D_MESSAGE" android:protectionLevel="signature" />

`

and the following receiver: `<receiver android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver" android:exported="false" /> <receiver android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver" android:exported="true" android:permission="com.google.android.c2dm.permission.SEND">

</receiver>`
tomasjuricek commented 5 years ago

Try to add that permissions:

[assembly: Permission(Name = "@PACKAGE_NAME@.permission.C2D_MESSAGE", ProtectionLevel = Android.Content.PM.Protection.Signature)] [assembly: UsesPermission(Name = "@PACKAGE_NAME@.permission.C2D_MESSAGE")]

RickB864 commented 5 years ago

the above permission did the trick. Thanks.