Closed hardikpatel679 closed 5 years ago
What is issue at android Q?
I believe Android Q is change on permission request on location.
https://android-developers.googleblog.com/2019/06/android-q-beta-4-and-final-apis.html
@hardikpatel679 @Maxwell6635 There are no issue for permission flow You can 2 choice
Manifest.permission.ACCESS_FINE_LOCATION
Manifest.permission.ACCESS_FINE_LOCATION
, Manifest.permission.ACCESS_BACKGROUND_LOCATION
And then you can check your permission. Check this link https://developer.android.com/preview/privacy/device-location#kotlin
This is example of this permission-checking logic appears in the following code snippet:
val permissionAccessCoarseLocationApproved = ActivityCompat
.checkSelfPermission(this, permission.ACCESS_COARSE_LOCATION) ==
PackageManager.PERMISSION_GRANTED
if (permissionAccessCoarseLocationApproved) {
val backgroundLocationPermissionApproved = ActivityCompat
.checkSelfPermission(this, permission.ACCESS_BACKGROUND_LOCATION) ==
PackageManager.PERMISSION_GRANTED
if (backgroundLocationPermissionApproved) {
// App can access location both in the foreground and in the background.
// Start your service that doesn't have a foreground service type
// defined.
} else {
// App can only access location in the foreground. Display a dialog
// warning the user that your app must have all-the-time access to
// location in order to function properly. Then, request background
// location.
ActivityCompat.requestPermissions(this,
arrayOf(Manifest.permission.ACCESS_BACKGROUND_LOCATION),
your-permission-request-code
)
}
} else {
// App doesn't have access to the device's location at all. Make full request
// for permission.
ActivityCompat.requestPermissions(this,
arrayOf(Manifest.permission.ACCESS_COARSE_LOCATION,
Manifest.permission.ACCESS_BACKGROUND_LOCATION),
your-permission-request-code
)
}
when will you provide android "Q" support?