Ahmad
Ahmad

Reputation: 12707

Is there a method to simulate (.NotDetermined) status from ABAddressBookGetAuthorizationStatus?

I am developing an App and testing on my physical iPhone.

At some point, the app checks if it is authorized to view the contacts (address book) of the phone using ABAddressBookGetAuthorizationStatus().

That call returns a status which can either be .Denied,.Authorized,.Restricted, .NotDetermined.

The last one is returned if you run the app for the first time, and have never approved or denied the app from accessing the device's address book.

Once you answer that authorization question, that answer is stored somewhere, and in the future, you will either get a .Authorized or .Denied status. Never again a .NotDetermined.

I tried deleting the app, and installing again. I tried changing the compile settings and changed the target build iOS. I did a Clean build, but I failed to get that status again.

I know I can copy the Xcode project and name the app something different to trick the iPhone into thinking this is a new app. But what is a straight forward way to let the app receive a .NotDetermined status again?

Upvotes: 2

Views: 98

Answers (1)

matt
matt

Reputation: 534893

Go into the General settings and Reset Location and Privacy. (This will have other side effects, but there's nothing you can do about that.)

Upvotes: 4

Related Questions