Open Hypocrate-code opened 9 months ago
@kengoon
@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
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 :
1) Here is my code in python :
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 ?2) 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.
3) 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