iCloud Document demo and iCloudDocument.entitlemen

Hello,


I try the trial version of the FMX iCL component to access the iCloud.
I created the certificate for the iCloud Document demo at the Apple Developer site and installed the mobileprovision file at the Mac. The access to the iCloud was also set.

I read also the documentation about the Entitlements. 

My problem is, your entitlement file has the following lines:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>get-task-allow</key>
<true/>
        <key>com.apple.developer.ubiquity-container-identifiers</key>
        <array>
                <string>$(TeamIdentifierPrefix)com.mycompany.myapplication</string>
        </array>
        <key>com.apple.developer.ubiquity-kvstore-identifier</key>
        <string>$(TeamIdentifierPrefix)com.mycompany.myapplication</string>
</dict>
</plist>

But If I compile the app to debug it on an iPhone the IDE creates a file with the following lines:


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>application-identifier</key>
<string>XXXXXXXX.de.mycompany.myapp</string>
<key>get-task-allow</key>
<true/>
<key>com.apple.developer.team-identifier</key>
<string>XXXXXXXX</string>
<key>keychain-access-groups</key>
<array>
<string>XXXXXXXX.de.mycompany.myapp</string>
</array>
</dict>
</plist>

Why the generated file has a complete another structure then yours? There is no <key>com.apple.developer.ubiquity-kvstore-identifier</key> entry. What could be the reason?

Maybe because of this differences the component can not initialitze the connection?

You need to create your own entitlements file that adds the appropriate keys and add it to the deployment window, replacing the default entitlements. The iCloud demo already has this included.

Hello Pieter, 


yes I know about it and I changed the entitlements file with my information and replaced it in the folder of the iCloud demo project. In the deployment window of the project I didn't change anything. 

Then I compile it and in \iOSDevice64\Debug\ folder I will get the entitlements file with the current date/time stamp but with standard entries. There is no <key>com.apple.developer.ubiquity-kvstore-identifier</key> entry. And that's why I get no access to the iCloud.

It seems it is a compiler problem. if I change the remote name in the deployment window to XXX.entitlements, no XXX.entitlements will be generated in the output path. But I don't know how I can fix it...

You should double-check the deployment window, it could be possible that the information was lost because the project file is created in an older RAD Studio. The Entitlements that is shown in the output Debug folder should match the template you have used when adding it to the Deployment Window. Otherwise, there is an error with deployment.

Thanks for you answer. Now I have solved the problem.


In the deployment window the local path  \iOSDevice64\Debug\ was wrong. In this path the compiler writes the new file after every new compilation. I had to delete this entry and to add the local file from my project folder.

And I thought the result has to be in  \iOSDevice64\Debug\ ;-)

Thanks for the feedback!

Only one more question: Where I can find the file that will be generated by the demo? 

I did make an iCloud Backup on the phone but the file doesn't appear online in Browser: https://www.icloud.com/#iclouddrive
Where can I access the files outside from the app?

Hi,


Unfortunately that's not how it works. When making a backup in the app, the app itself is referenced under iCloud, but that is not available outside of the iCloud application. iCloud.com cannot reference documents generated by apps that use the iCloud Document approach. You can synchronize documents between devices and between a device and the Mac, if they reference the same container. Below is a short explanation on how the backup system works on iOS and macOS.

https://support.apple.com/en-us/HT204215#findiCloud


Pieter Scheldeman2019-06-26 16:35:33