iOS8 crash when try to use UIDocumentMenuViewContr

2019-09-16 13:00发布

I use Xamarin.Forms to create iOS app and I use UIDocumentMenuViewController to Access iCloud file.

When I run program on iOS9+ program is run normally, But when I try my program with iOS8 emulator program is crash on

new UIDocumentMenuViewController(allowedUTIs, UIDocumentPickerMode.Import);

and message is saying

'Application initializing document picker is missing the iCloud entitlement. Is com.apple.developer.icloud-container-identifiers set?'

What wrong with my app and how can I fix this?

Thank you in advance.

2条回答
女痞
2楼-- · 2019-09-16 13:22

Check that you have linked Entitlements.plist to your project...

I dont know why, but by default Entitlements.plist is not linked, you can do the same by going to option of project and assign custom Entitlement like this!

enter image description here

查看更多
孤傲高冷的网名
3楼-- · 2019-09-16 13:31

You need to make sure that you have enabled the iCloud Entitlements as described here.

This is even mentioned in the official iOS documentation:

Before your app can use the document picker, you must turn on the iCloud Documents capabilities

If you haven't done so already, simply create a new Entitlements.plist file in the root of your project. Then simply enable the iCloud option.

查看更多
登录 后发表回答