Closed bernamaxim closed 1 year ago
Have you tried enabling it?
Yes I have. But, it cannot enable.
Looks like you're right. We need to enable it.
Wait. I just checked the documentation again and it says explicitly:
Note: Apps don't need to request the POST_NOTIFICATIONS permission in order to launch a foreground service. However, apps must include a notification when they start a foreground service, just as they do on previous versions of Android.
So it seems like it's not required.
Just to be sure I tested it and I can see that the foreground service is running:
Are you sure to use Android 13 for testing?
Yes, absolutely. I'm using Android 13 emulator
I have tested again to make sure.
I clear memory and cache on my device and reinstall Traccar.
About 25 minutes ago I run Traccar and sweep away (to make sure running in background)
For several updates it not problem until first 5 minutes.
After waiting for 20 minutes, it not update anymore.
But after I opened app, it start to update again. Execute startForeground (with process: "service started" and "network online")
Note:
Android 13 kill app on background, maybe notification on foreground must need runtime permission, because it not turn on automatically.
https://developer.android.com/develop/ui/views/notifications/notification-permission