Skip to content

Commit e7d1885

Browse files
Update Android background location permission flow for API 30+
- Implement special handling for `ACCESS_BACKGROUND_LOCATION` on API >= 30 in `AndroidImplementation.java`. - Bypass `ActivityCompat.requestPermissions` and guide users to Settings. - Add localization keys for new dialog strings. - Update developer guide with instructions on new behavior and build hint requirements.
1 parent f72026e commit e7d1885

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/developer-guide/Miscellaneous-Features.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,9 +454,9 @@ LocationManager.getLocationManager()
454454

455455
On Android 11 (API level 30) and higher, requesting background location permission requires a two-step process. First, foreground location permissions must be granted. Then, the app must request background location access, which will direct the user to the system settings to select "Allow all the time".
456456

457-
Codename One handles this flow automatically when you use `LocationManager`. If your app targets Android 10 (API level 29) or higher, you can enable the background permission request by setting the build hint `android.requiresBackgroundLocationPermissionForAPI29=true`.
457+
Codename One handles this flow automatically when you use `LocationManager`. You can enable the background permission request by setting the build hint `android.requiresBackgroundLocationPermissionForAPI29=true`.
458458

459-
For API 30+, Codename One detects if background location is needed and presents a dialog explaining the requirement before redirecting the user to the app settings. You can customize the permission prompt message using the localization key `android.permission.ACCESS_BACKGROUND_LOCATION`.
459+
For Android 11+ (API 30+), Codename One detects if background location is needed and presents a dialog explaining the requirement before redirecting the user to the app settings. You can customize the permission prompt message using the localization key `android.permission.ACCESS_BACKGROUND_LOCATION`.
460460

461461
[source,java]
462462
----

0 commit comments

Comments
 (0)