Closed wychwitch closed 7 months ago
Hello @wychwitch,
I think that I have found the problem. The problem is that I have forgotten to add an important step to the documentation.
Apologies :(
Please add the following line to your code:
func _ready():
$NotificationScheduler.init() # please add this line to initialize the plugin node
# then you can start using the node methods
if !$NotificationScheduler.has_post_notifications_permission():
...
Otherwise, your code looks perfect.
Thanks for using the plugin.
Yep that was it, thank you!
Unfortunately I now have two other issues, the first is that I have the same crashing problem as issue #1 , which I'll post in there in a bit hahaha
The second issue is that the notification isn't sent while the game is in the background. Is that intended behavior? I was hoping for it to be scheduled to go off after a certain amount of time regardless of if the game is open or not.
Either way, thank you so much for this plugin! I tried for weeks to make one myself but I never was able to get something working
edit: I think what I was describing is actually something that uses the permission <uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/>
(found here), though I'm sure if you've already seen this!
Hi @wychwitch, I believe that both of your issues are a result of the bug mentioned in #1 . The alarms should be triggered whether your app is running or not. This should be working on devices running Android 11.
I'm sorry if I missed something obvious, but I've been slamming my head against the wall trying to figure this out. I followed the instructions to set up the plugin, including installing to the addons folder (which I created) and created a button that should trigger the notification when pressed. However it does nothing and using the adb logcat I saw the error
GodotAndroidNotificationSchedulerPlugin singleton not initialized!
pop up.Everything else seems to work, including the plugin managing to request permissions, but it just fails when trying to schedule the notification.
Also just to be sure, I copied the drawable icon over from android studio into the android/build/res folder (it was listed as drawable, and its type is .xml)
Here's my code, which is just placed on the root 2d node.
I'm using android 14 if that matters! Any help would be amazing. Thank you for making such a great plugin!!