FirebasePushNotificationPlugin icon indicating copy to clipboard operation
FirebasePushNotificationPlugin copied to clipboard

Sendo push to device android 13

Open ivanteles opened this issue 2 years ago • 4 comments

I followed the implementation guide. However, in android 13 it does not request permission to send a push and even manually informing that I can receive notification, the notification does not arrive in versions 13. In other versions it is working fine. Any tips on how to resolve?

ivanteles avatar Jul 27 '23 16:07 ivanteles

I got the same problem. Notifications arrive when the app is open but not when it is closed. Happens at least on Android 13. On an older Device it works.

StefanOber avatar Aug 02 '23 19:08 StefanOber

If your targetsdk is >=33 then you need POST_NOTIFICATIONS permission (google about implementation). Sometimes Firebase take some time to register your Token. Call FirebasePushNotificationManager.Initialize without resetting the token. Try restart your device and/or publish your app in release mode. Implement a custom PushNotificationHandler (derive from DefaultPushNotificationHandler) and override OnReceived. If OnReceived is called, then inspect DefaultPushNotificationHandler OnReceived and find out why the method returns without showing your message. Good luck.

AlleSchonWeg avatar Aug 03 '23 07:08 AlleSchonWeg

@AlleSchonWeg Give me your address and I will send you some chocolate. POST_NOTIFICATIONS permission was the problem. Thanks!!!

StefanOber avatar Aug 03 '23 07:08 StefanOber

@AlleSchonWeg sorry to bother you, if i set the target framework to Android 33 the namespace Plugin.FirebasePushNotification is not available anymore. Is there a way to make it work?

Edit: never mind setting it from the project properties interface messed up the csproj file, i manually added

<TargetPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">
    33
</TargetPlatformVersion>

and it works.

Ghevi avatar Oct 30 '23 15:10 Ghevi