-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
Fixs pending Intent issue on Godot 3.5 #32
base: master
Are you sure you want to change the base?
Conversation
Pause merging this im looking into a small bug. |
what is the status of this PR ? |
@rondlite in general looks like the pushes work |
Hi all, Could someone potentially explain to me how I would implement this fix for my current project? I can't install this via NativeLib since it hasn't been merged as far as I know so I'm pretty lost on how to continue from here. Any help is much appreciated :) Edit: I think i got it, if i replace the .aar file in the android/plugins folder with the one from your release (please correct me if I'm wrong) |
No crashes but also no notifications in Android 12, On Android 10 it all works as intended. |
@Kontrano hi,
in case you debug it on a device you previously ran a problematic version - android will block your notification request as "bad process" you can verify it in logcat. |
@yan88a I would love to, but I am not sure how to accomplish that. Could you potentially give me an overview of the steps that I need to do to accomplish this? I would be very thankful. Btw I'm using the Nativlib GUI implementation if that matters. |
@Kontrano I won't be near my pc in the next few days. Hope it helps. If you still have trouble, I can try and send you the aar around the weekend |
@yan88a I was missing the last permission "android.permission.POST_NOTIFICATIONS" so at least that's one step forward but I still couldn't get it to work. Currently, I am using the .aar file from @finepointcgi that he has in the latest release on his fork but I'm thinking this may not include the latest fix. since I have no clue on how to build this (I have since figured out that this is somehow done via android studio I think) So I've added all 3 permissions and am using the .aar file I mentioned above. I have now also tested it on 1 physical android 12 device and 3 emulated ones, following the uninstall and restart process for the physical one and making new virtual devices for the emulated ones. It worked on none of them sadly. I also tried an emulated android 10 device and it worked like a charm again. So I'm guessing its something wrong with the .aar file. So if you could send me yours I would be very grateful :) |
@Kontrano hey, |
@yan88a Was there any changes to the code in my pr for it to work for you? If not ill check my release and see whats going on.. Edit: I miss read the thead! If you fixed it I can drop this pr and have you just throw one in. |
@finepointcgi - all is your doing :) |
@yan88a Thanks a lot this one works like a charm.so far no issues other than that the notifications don't have the logo on android 12 but thats a minor thing. Again thanks to you both and everyone who makes and maintains these vital plugins. |
Ive updated with some of the stuff discussed here. Should be good to merge now. Drafted a release https://github.com/finepointcgi/godot-local-notification/releases/tag/v0.2.4 |
Hi @finepointcgi , Thank you very much for the pr. It should work but I do think we should keep FLAG_UPDATE_CURRENT. Without it, when user click on the notification to open the game, it may not display the notification messages or even can crash on some devices. Like so
Also, the Pending intent in Here i'v tested and recompile for anyone who is in rush :D |
This should be good to merge also thank you @kyoz for the help i have updated it |
Thank you so much guys, you just saved a life! :D |
Hello, In the meantime, I've tried to install the source code, but I'm not able to compile. Can you help me? |
Fixes this specific bug
Exception java.lang.IllegalArgumentException: org.godotengine.sweepit: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
at android.app.PendingIntent.checkFlags (PendingIntent.java:375)
at android.app.PendingIntent.getBroadcastAsUser (PendingIntent.java:645)
at android.app.PendingIntent.getBroadcast (PendingIntent.java:632)
at ru.mobilap.localnotification.LocalNotification.getPendingIntent (LocalNotification.java:147)
at ru.mobilap.localnotification.LocalNotification.cancelLocalNotification (LocalNotification.java:125)
at org.godotengine.godot.GodotLib.step
at org.godotengine.godot.GodotRenderer.onDrawFrame (GodotRenderer.java:57)
at org.godotengine.godot.gl.GLSurfaceView$GLThread.guardedRun (GLSurfaceView.java:1576)
at org.godotengine.godot.gl.GLSurfaceView$GLThread.run (GLSurfaceView.java:1278)
let me know if theres anything I need to change.