Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Setting screen request code #125

Open
Ahmed-Ganna opened this issue Jul 24, 2022 · 0 comments
Open

Setting screen request code #125

Ahmed-Ganna opened this issue Jul 24, 2022 · 0 comments

Comments

@Ahmed-Ganna
Copy link

When i press enable GPS button in the default provider GPS dialog, it opens the setting screen with request code RequestCode.GPS_ENABLE but onActivityResult is being called with a random request code that does not match RequestCode.GPS_ENABLE.

Configuration

val isGooglePlayAvailable = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(Utils.getApp()) == ConnectionResult.SUCCESS

        val conf = LocationConfiguration.Builder()
            .askForPermission(
                PermissionConfiguration.Builder()
                    .rationaleMessage(StringUtils.getString(R.string.enable_location_rational_message))
                    .build()
            )

        return conf.also {
            if (isGooglePlayAvailable){
                it.useGooglePlayServices(
                    GooglePlayServicesConfiguration.Builder()
                        .failOnSettingsApiSuspended(true)
                        .build()
                )
            }else{
                it.useDefaultProviders(
                    DefaultProviderConfiguration.Builder()
                        .gpsMessage(StringUtils.getString(R.string.location_gps_message))
                        .build()
                )
            }
        }.build()
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant