You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey !
I resolved the previous issues i had,
Now i get it working in some ways, but i need help for a few details :
Here is my code in python :
@mainthreaddefsend_notification(content):
print("notification about to be sent")
create_notification(
small_icon=get_resource("drawable").ic_launcher,
channel_id="ch1", # you must set this to any string value of your choicetitle="HypLoad", # title of your notificationtext=f"{content}", # notification content textids=1, # notification id, can be used to update certain notificationchannel_name=f"message",
action_title1="action1",
priority=NotificationCompat().PRIORITY_MIN
)
print("notification sent")
I use the decorator @mainthread to get it working, because notifications have to be sent with the main thread, otherwise i get all the problems i was talking about before (can't use create_notification because the function can't access some androidx and android values)
Whereas, i want the notification to be sent when the app is left but still opened
But if i launch them with the main thread, they only appear when i go back to the app, because the main thread is stopped when the app is left.
So do you have any ideas on how i could proceed to have notifications sent when the app is active but not opened ?
When i use get_resource("drawable").ic_launcher (ic_launcher.png being my resource added as a drawable), the icon appears but is totally grey, instead of having its colors of origin.
NotificationCompat().PRIORITY_MIN works just as NotificationCompat().PRIORITY_LOW that works just as if no priority was set. How can i get it working (i don't want it to show up on the screen, but just to appear in the status bar)
IMPORTANT FACT : with android.api = 34, for me, create_notification was not creating any error but didn't do anything. Now that i have android.api = 32, notifications are sent but i still have issues mentionned above
Thanks for your time
The text was updated successfully, but these errors were encountered:
Hypocrate-code
changed the title
Notification on a different thread, and small_icon problem
Sending notification on a different thread, small_icon problem, and priority not working
Oct 8, 2023
@Hypocrate-code Using android API 34, you have to add the the POST_NOTIFICATION permission to your buildozer permission and also request for it too.
For the grey icon, that has nothing to do with kvdroid, watch this video to understand how to solve your issues
For the priority, it only works on Android version 7 below. Feature update would be added for android version 8 above
kengoon
changed the title
Sending notification on a different thread, small_icon problem, and priority not working
Priority not working on Android version 8 and above
Oct 9, 2023
Thanks for your answers !
I'll try it out asap,
Did you understand the problem with threads/sending notification when the app is opened and left ? Do you need more context ?
@Hypocrate-code use a service to send notifications, services run in the background. Don't ask me how to use service, go and figure that out on your own
Hey !
I resolved the previous issues i had,
Now i get it working in some ways, but i need help for a few details :
I use the decorator
@mainthread
to get it working, because notifications have to be sent with the main thread, otherwise i get all the problems i was talking about before (can't use create_notification because the function can't access some androidx and android values)Whereas, i want the notification to be sent when the app is left but still opened
But if i launch them with the main thread, they only appear when i go back to the app, because the main thread is stopped when the app is left.
So do you have any ideas on how i could proceed to have notifications sent when the app is active but not opened ?
When i use get_resource("drawable").ic_launcher (ic_launcher.png being my resource added as a drawable), the icon appears but is totally grey, instead of having its colors of origin.
NotificationCompat().PRIORITY_MIN works just as NotificationCompat().PRIORITY_LOW that works just as if no priority was set. How can i get it working (i don't want it to show up on the screen, but just to appear in the status bar)
IMPORTANT FACT : with android.api = 34, for me, create_notification was not creating any error but didn't do anything. Now that i have android.api = 32, notifications are sent but i still have issues mentionned above
Thanks for your time
The text was updated successfully, but these errors were encountered: