UIDocumentPickerViewController error due to lack of iCloud permission

I use UIDocumentPickerViewControllerin my iOS application to allow users to open external files. I added the appropriate iCloud permissions to my application package, and most of the time everything works fine.

However, sometimes the document collector will fail, complaining that the application does not have this iCloud right. I experimentally discovered that when this happens, the value is [NSFileManager defaultManager].ubiquityIdentityTokenusually nil, so I protected my call with a document collector and checked ubiquityIdentityTokenas a temporary measure.

Can someone shed light on what can happen here, and what can I do to avoid this collapse? It seems almost completely out of my control.

+4
source share
2 answers

The case of my application also - I just want to use the File Provider features and do not specifically support iCloud Drive.

I can’t shed some light on why it seems to lose touch with iCloud, but it’s not a β€œcrash” - it [[UIDocumentPickerViewController alloc] init___]throws an exception that you can catch with the try / catch block. That is, I suspect that your application crashes with an "uncaught exception" - if you catch it, you can simply give an error message.

+3
source

, . , iCloud, , , UIDocumentPickerViewController . UIKit, .

, , , , ?

0

All Articles