iOS simulator permission denied and not showing pe

2019-03-28 11:53发布

I'm working on iOS simulator and am facing issues for requesting permissions.

My app was working properly and it could access to photo library, camera and location service. But after installing new XCode (8.1), I run the app on simulator, the app is not allowed to use photo library or camera or location service any more.

I tried to ask the permission programmatically, but it did not show permission request dialog and always return denied status even though I added the privacy descriptions and bundle display name.

3条回答
做个烂人
2楼-- · 2019-03-28 12:05

Try to delete the simulator in ~/Library/Developer/CoreSimulator/Devices/xxxxx-xxx-xxxx, and copy a new one from other machine

查看更多
一夜七次
3楼-- · 2019-03-28 12:11

I found the issue. This is because your Xcode is not put in Applications folder. Move Xcode to this folder and enjoy.

查看更多
我只想做你的唯一
4楼-- · 2019-03-28 12:16

Make sure your .plist looks like this

<key>NSCameraUsageDescription</key>
<string>This app needs access to the camera to take photos.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>This app needs access to photos.</string>

And also if you disabled any changes to photo library privacy in your restrictions your app won't be able to use your photo library (it won't even ask for permission) until you turn off restrictions.

查看更多
登录 后发表回答