I am developing an iOS app which download the file from local server and after syncs to iCloud. But i am not able to see my application container nor the files on iCloud drive. But i can see them in settings >> iCloud >> iCloud drive >> storage >>Manage Storage with my default iOS icon. I have done the things like bumping the bundle version and added the following keys in info.plist.
<key>NSUbiquitousContainers</key>
<dict>
<key>iCloud.com.abc.MyApp</key>
<dict>
<key>NSUbiquitousContainerIsDocumentScopePublic</key>
<true/>
<key>NSUbiquitousContainerName</key>
<string>MyApp</string>
<key>NSUbiquitousContainerSupportedFolderLevels</key>
<string>Any</string>
</dict>
</dict>
I have used this code to save on iCloud -
document = (MyDocument *)[[UIDocument alloc]initWithFileURL:[NSURL URLWithString:[NSString stringWithFormat:@"file://%@",filePath]]];
dispatch_async(dispatch_get_main_queue(), ^{
NSError *error;
bool isStored = [fm setUbiquitous:true itemAtURL:[document fileURL] destinationURL:[[ubiq URLByAppendingPathComponent:@"Documents" isDirectory:true] URLByAppendingPathComponent:[document fileType]] error:&error];
if (error) {
NSLog(@"Error is%@",[error localizedDescription]);
}
if (isStored) {
NSLog(@"saved on cloud");
}
Note: My application is not live.