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

Android trouble? #31

Closed
rondlite opened this issue Sep 4, 2022 · 17 comments
Closed

Android trouble? #31

rondlite opened this issue Sep 4, 2022 · 17 comments

Comments

@rondlite
Copy link

rondlite commented Sep 4, 2022

What seems to be the problem on Android since it works like a charm !
You need POST_NOTIFICATIONS set as custom permission..
or is it just with the daily?

@yan88a
Copy link

yan88a commented Sep 23, 2022

seems android 12 changed its notification management system
so once you try to use the current one - the project crashes..

@Kontrano
Copy link

Kontrano commented Oct 7, 2022

Is there currently an issue wtih Notifications or does everything still work?

@yan88a
Copy link

yan88a commented Oct 7, 2022

Hey @Kontrano ,
yep,
compiling on godot 3.5 for target sdk 31 (android) wont work for me..
at firs it used to crash..
after adding the following permissions:
android.permission.SCHEDULE_EXACT_ALARM
android.permission.USE_EXACT_ALARM
app wont crash. but notifications wont work. any ideas?

@Kontrano
Copy link

Kontrano commented Oct 7, 2022

Not currently but i need to get it working for an app im working on aswell, so ill try tinkering over the coming week if i can get it to work somehow

@rondlite
Copy link
Author

rondlite commented Oct 10, 2022

This is the problem currently:

FATAL EXCEPTION: GLThread 42
Process: com.***.***, PID: 20544
java.lang.IllegalArgumentException: com.***.***: 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.showLocalNotification(LocalNotification.java:92)
	at org.godotengine.godot.GodotLib.step(Native Method)
	at org.godotengine.godot.GodotRenderer.onDrawFrame(GodotRenderer.java:59)
	at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1573)
	at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1272)

It is a change in SDK requirements, FLAG_MUTABLE, has to become FLAG_IMMUTABLE

@Kontrano
Copy link

So do we need to do anything? or will it actually just work? I'm not exactly following (I haven't actually started working with it yet)

@yan88a
Copy link

yan88a commented Oct 10, 2022

@Kontrano - wont work for me...
note that you need to add the permissions i mentioned above as well to avoid crash

@yan88a
Copy link

yan88a commented Oct 12, 2022

@Kontrano played with it a bit & looks like it works..
you can use this one -
https://github.com/yan88a/godot-local-notification

@Kontrano
Copy link

Nice, This works for Android 12 then as well?

@yan88a
Copy link

yan88a commented Oct 12, 2022

looks ok
didnt do any in depth testing
but managed not to crash & get notification

@Kontrano
Copy link

Nice ill do some testing in the coming week aswell and let you know

@Kontrano
Copy link

@yan88a Btw, do you have a way to show the notifications while the app is out of focus or in the background?

@rondlite
Copy link
Author

rondlite commented Oct 15, 2022 via email

@Kontrano
Copy link

You set the time in minutes and it will show no matter if the app is in memory or not Op zo 16 okt. 2022 01:09 schreef Kontrano @.>:

@yan88a https://github.com/yan88a Btw, do you have a way to show the notifications while the app is out of focus or in the background? — Reply to this email directly, view it on GitHub <#31 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA4F2TTGK2RKUZB2J7FPNQDWDM2SPANCNFSM6AAAAAAQEG52WE . You are receiving this because you authored the thread.Message ID: @.
>

Could you give my an example? since im not fully following unless you mean the interval in the show command?
show(message: String, title: String, interval: float, tag: int, repeating_interval: int = 0)

@yan88a
Copy link

yan88a commented Oct 16, 2022

@Kontrano it should work that way since you register the notification into android.
but, it seems i have some bugs
1st - app icon shown weird
2nd - notification wont show outside the app...

will poke it a bit this week...

@rondlite
Copy link
Author

Could you give my an example? since im not fully following unless you mean the interval in the show command?

Yes the interval in the show command, for instance I set it to 24 hours (in seconds) as soon as I give a user the daily award.
This way the next day a notification is shown reminding user to come back to the app

@rondlite
Copy link
Author

Seems this issue is being fixed #32, so this one is double ...

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

No branches or pull requests

3 participants