Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pushnotifications on Android 13 #377

Closed
molbertz opened this issue Sep 15, 2023 · 4 comments · Fixed by #379
Closed

Pushnotifications on Android 13 #377

molbertz opened this issue Sep 15, 2023 · 4 comments · Fixed by #379

Comments

@molbertz
Copy link
Contributor

molbertz commented Sep 15, 2023

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 was referenced Sep 15, 2023
@jperedadnr
Copy link
Contributor

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?

@molbertz
Copy link
Contributor Author

molbertz commented Sep 25, 2023

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?

@molbertz
Copy link
Contributor Author

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.

@jperedadnr
Copy link
Contributor

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants