ABAddressBookGetAuthorizationStatus in simulator always returns kABAuthorizationStatusAuthorized

一个人想着一个人 提交于 2019-11-27 08:09:37

问题


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


回答1:


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



来源:https://stackoverflow.com/questions/12602984/abaddressbookgetauthorizationstatus-in-simulator-always-returns-kabauthorization

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!