gluonhq/attach

Pushnotifications on Android 13

Closed this issue · 4 comments

The Notification service needs updating for Android 13. As it is now the notifications don't show up.
It seems a lot of things have changed in that regard.

For example: From what I can tell you need to explicitly request the user's permission in the main activity. That seems to be a problem since the main activity is located in the Substrate project, isn't it?
I got the info from here:
https://firebase.google.com/docs/cloud-messaging/android/client?hl=de#request-permission13

Anyway, can you please take a look at the issue? Sooner or later more and more people will certainly run into this problem.

Thank you!

Edit: Firebase also has a sample project. Maybe that can be of help:
https://github.com/firebase/quickstart-android/blob/master/messaging/app/src/main/java/com/google/firebase/quickstart/fcm/java/MainActivity.java

This should be fixed with #379
If you want to go ahead and test it, you could build from my branch and use the local snapshot?

Thank you for your reply. I've checked out the branch you mentioned and tested it with a Google Pixel 7 running Android 13. The notifications show up again. Great work!

EDIT: I forgot to ask; I've changed the Android Platform to "33" in attach-2/gradle/native-build.gradle because I got an error while compiling (I only have the Android 13 (33) toolchain installed).
That seems to work for me.
Is that an oversight on your part or was I just lucky to fix my build error?

Hello again,

I writing to let you know that it seems like this fix was never merged into the master branch.

We just found out because for some reason my locally built attach lib (from your branch: 378-android33) was overwritten with the official one. Since then we noticed that on Android 13 and later no consent screen was shown for notification permissions. Therefore the apps didn't receive notifications anymore.

If there is anything more from me you need, please let me know. Cheers.

Thanks for the reminder... the PR somehow got lost... we have merged it now, and you can test with the snapshot 4.0.21-SNAPSHOT (from Sonatype)