Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Permission.FineLocation not working on iOS #229

Open
vanniktech opened this issue Dec 25, 2024 · 0 comments
Open

Permission.FineLocation not working on iOS #229

vanniktech opened this issue Dec 25, 2024 · 0 comments

Comments

@vanniktech
Copy link

I have:

val permissionState = rememberPermissionState(Permission.FineLocation)

and then when a button is pressed I do:

        when (permissionStatus) {
          PermissionStatus.Granted -> requestCurrentLocation()
          is PermissionStatus.Denied -> when (permissionStatus.shouldShowRationale) {
            true -> permissionRationalDialog = true
            false -> {
              hasRequestedLocation = true
              permissionState.launchPermissionRequest()
            }
          }
        }

the problem is on iOS, this permission dialog:
Screenshot 2024-12-25 at 19 55 23

is never shown. It just seems like the implementation for iOS is buggy or am I misusing the API?

I did manage to trigger the Permission Dialog manually via:

class AppDelegate : NSObject, UIApplicationDelegate {
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
        let test = CLLocationManager()
        test.requestWhenInUseAuthorization()
        return true
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant