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
The CrossPlatformLocation demo works nicely, but I think some improvements can be made to keep the app behavior consistent across distinct Android versions, most specifically related to the foreground service notification display:
Notification should setForegroundServiceBehavior to FOREGROUND_SERVICE_IMMEDIATE so it displays as soon the service starts (Android 12+). I get the rationale behind the 10-second delay introduced in Android 12 but I think a background location service is expected to run for several minutes anyway. Also, such a delay made me think that the foreground service was not being started at all on my first tests 🤦♂️.
Notification should setOngoing to true so that the user doesn't dismiss it. Since Android 13 the user can dismiss foreground service notifications, but for a sensitive thing like background location tracking I think it should stay permanent, like on older Android versions, and also for ease of access to the app.
App should request the runtime POST_NOTIFICATIONS permission (Android 13+). The foreground service still runs without this permission but the notification doesn't shows up as it never asks for this permission.
I also thought about suggesting to call startForeground with the foregroundServiceType parameter (Android 13+), but given it defaults to all service types declared in the manifest I see that's only relevant for apps with multiple such types declared.
The text was updated successfully, but these errors were encountered:
The CrossPlatformLocation demo works nicely, but I think some improvements can be made to keep the app behavior consistent across distinct Android versions, most specifically related to the foreground service notification display:
Notification should
setForegroundServiceBehavior
toFOREGROUND_SERVICE_IMMEDIATE
so it displays as soon the service starts (Android 12+). I get the rationale behind the 10-second delay introduced in Android 12 but I think a background location service is expected to run for several minutes anyway. Also, such a delay made me think that the foreground service was not being started at all on my first tests 🤦♂️.Notification should
setOngoing
totrue
so that the user doesn't dismiss it. Since Android 13 the user can dismiss foreground service notifications, but for a sensitive thing like background location tracking I think it should stay permanent, like on older Android versions, and also for ease of access to the app.App should request the runtime
POST_NOTIFICATIONS
permission (Android 13+). The foreground service still runs without this permission but the notification doesn't shows up as it never asks for this permission.I also thought about suggesting to call
startForeground
with theforegroundServiceType
parameter (Android 13+), but given it defaults to all service types declared in the manifest I see that's only relevant for apps with multiple such types declared.The text was updated successfully, but these errors were encountered: