Skip to content

Wrong Location Permission behavior #124

@vadimue

Description

@vadimue

I am developing an app, which uses location always. So I request Location permission with status "Always" on viewDidLoad() of WelcomeViewController. Steps of this flow:

  1. App show alert with three buttons "Only when using the app", "Always Allow", "Don't Allow".
  2. User chooses "Only when using the app".
  3. User reopen app and did not see any notification
  4. User reopens app again (and all next times) and sees the denied notification.

The problem is user don't see notification second time. I read a source code and find out the line of cause such behavior: On second time UserDefaults.standard.requestedLocationAlwaysWithWhenInUse still false, so we have wrong status of location permission that's why app requests permission again instead of showing denied alert. And in this second requesting UserDefaults.standard.requestedLocationAlwaysWithWhenInUse became true, so on third time we have correct status.

Frankly, I don't know how to fix this problem by the clean way, can you have any suggestion?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions