question

krubakhal avatar image
krubakhal asked krubakhal edited

How to get location co-ordinates, in Clover Flex 3. Location permission added in not asking user to allow the permission

How to location co-ordinates, in Clover Flex 3. Location permission added in not asking user to allow the permission. In setting app info, location permission ask not showing in permission section. I have use those permission.

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />


if (ActivityCompat.checkSelfPermission(
        this, Manifest.permission.ACCESS_FINE_LOCATION
    ) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(
        this, Manifest.permission.ACCESS_COARSE_LOCATION
    ) != PackageManager.PERMISSION_GRANTED
) {
    // Request permissions
    ActivityCompat.requestPermissions(
        this, arrayOf(Manifest.permission.ACCESS_FINE_LOCATION), 1
    )
    return
}
if (!locationManager?.isProviderEnabled(LocationManager.GPS_PROVIDER)!!) {
    // Prompt user to enable GPS
    showLocationGpsDialog()
    return
}

// Dialog
 CommonUtil.openGeneralDialogYesNo(
                this@ParkingEnforcementActivity,
                resources.getString(R.string.location_gps_title),
                resources.getString(R.string.location_gps_message),
                "",
                onclickYes = {
                    Constants.locationPermissionAskedOnce = true
                    val intent = Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS)
                    locationGPSPermissionResult.launch(intent)
                },
                onclickNo = {
                    Constants.locationPermissionAskedOnce = true
                }, false, hideNo = false, yesInt = R.string.okay, noInt = android.R.string.cancel
            )
Clover Android SDKClover Flex
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community