Closed MarkoZlender closed 1 month ago
@MarkoZlender are you trying to use the plugin on non-android device?? Plugin will not work in editor, you should try using a android device or an emulator
@MarkoZlender are you trying to use the plugin on non-android device?? Plugin will not work in editor, you should try using a android device or an emulator
@anishmishra0 I am testing it on android device yes, when I press the button nothing happens.
I use Xiaomi phone and I turned off battery optimizations and enabled all notifications for the app.
@MarkoZlender I didn't noticed it first But you will have to set some delay Try this
func _on_button_pressed():
my_notification_data.set_id(1)
my_notification_data.set_channel_id("my_channel_id")
my_notification_data.set_title("My Notification Title")
my_notification_data.set_content("My notification content")
my_notification_data.set_small_icon_name("ic_name_of_the_icon_that_you_generated")
my_notification_data.set_delay(5)
$NotificationScheduler.schedule(
my_notification_data
)
@MarkoZlender I didn't noticed it first But you will have to set some delay Try this
func _on_button_pressed(): my_notification_data.set_id(1) my_notification_data.set_channel_id("my_channel_id") my_notification_data.set_title("My Notification Title") my_notification_data.set_content("My notification content") my_notification_data.set_small_icon_name("ic_name_of_the_icon_that_you_generated") my_notification_data.set_delay(5) $NotificationScheduler.schedule( my_notification_data )
Tried it already with the button, in the _ready function, but none of that works, same as without the delay.
I tried doing it with the demo app as well, but I don't receive any notifications.
@MarkoZlender have you setup icon correctly and name of icon match??
my_notification_data.set_small_icon_name("ic_name_of_the_icon_that_you_generated")
@MarkoZlender have you setup icon correctly and name of icon match??
my_notification_data.set_small_icon_name("ic_name_of_the_icon_that_you_generated")
Is that necessary for addon to work?
Is that necessary for addon to work?
yes
@MarkoZlender Is your problem solved ??
It's working now yes. Thank you for pointing out the icon part. Although please add short instructions to the README for generating icons.
For anyone in the future having problems with this:
android/build/res
folder and make sure they contain icons with your specified name:
my_notification_data.set_small_icon_name("<your_notification_icon_name_here>")
It's working now yes
That's Great, @MarkoZlender close this issue as completed.
The plugin is enabled in the project and this is the code that I use on Godot 4.2.2, tried on 4.3 but the same thing happens: