ABAddressBookGetAuthorizationStatus in simulator always returns kABAuthorizationStatusAuthorized
Asked Answered
M

1

4

I am updating an app for iOS 6 Address Book authorization and have hit a problem in testing. The simulator always returns that authorization is granted. This means I do not see the dialog popup requesting permission and can therefore not test that code path. Ok, use a device instead... The problem there is the OS appears to remember my answer so only asks once. Deleting the app does not help. On reinstalling it has retained the permission setting from before, so again no popup.

Resetting the simulator does not help and if you go into the Privacy settings on the simulator no apps are listed as requesting permission to the Address Book.

The only option I have is use another iOS device that has never had our app installed on for each test. This cannot be how you are supposed to test this. Any ideas anyone?

Thanks

Mirthamirthful answered 26/9, 2012 at 13:34 Comment(0)
M
13

Found it. From the device, Settings->General->Reset->Reset Location & Privacy. So you have to do that for each test

Mirthamirthful answered 26/9, 2012 at 13:46 Comment(4)
under simulator this option doesn't work. i cant say anything about device since i dont have any device with ios 6Glume
To clarify the answer, the rest locations/privacy option ONLY works on a device. It doesn't work in the simulator. Wish I realized this months ago.Nipha
This will reset settings for all apps, how do reset only for the app I'm developing/testing ?Juridical
Under iOS 7 this is now works in the Simulator as well.Cordwain

© 2022 - 2024 — McMap. All rights reserved.