0

I try to implement the Ensembles iCloud sync for the Cocoa app of our already working and syncing iOS apps. Because I have a problem in that Cocoa app, I thought to try the Ensembles sample app.

So I try to get the Idiomatic App for OSX to sync through iCloud. But I always get the same error, that I am not logged into iCloud, because

[fileManager URLForUbiquityContainerIdentifier:ubiquityContainerIdentifier]

always returns nil for me.

I am logged into iCloud on my Macbook and sync for eg DayOne works fine between iPhone and Macbook. So, not being logged in could not be the problem. The question is, why the FileManager does not return the Identifier?

I hassle with this for three days now and it worked already for some time and broke because of 'I don't know'. I restored my ~/Library folder from TimeMachine and then it worked for some time again, but also broke again. Then I created a new OS user and used another Apple-ID for iCloud, it worked for some time and broke again.

I am really a little confused, am not sure, if it has something to do, with Signing, Sandboxing, Provisioning ... or whatever.

So, what did I do?

I opened the Ensembles 1.4 Idiomatic project, On the Target-General-Tab I changed the BundleIdentifier, I enabled MacAppStore Signing and I chose our DevTeam.

On the Capabilities-Tab I enabled AppSandbox and iCloud Capabilities, specified custom containers and chose the newly created iCloud container,

On the BuildSettings-Tab I chose the Mac Developer CodeSigningIdentity and the MacTeamProvisioningProfile for our BundleID. (I would just post screenshots, but haven't enough reputation points for that.)

Also, disabling the Sandboxing capability does not help.

Has anyone an idea, or knows, what thing I am missing? Any 'magic' folders in ~/Library that has to be deleted? Logging in and out of iCloud? Deleting the container on the iCloud servers? Or do I have to completely new start the App-Id-Certificate-ProvisioningProfile-hassle, to perhaps solve this issue?

Could it be, that my iCloud accounts have been corrupted?

Any help appreciated, thanks in advance for it.

Nat
  • 12,032
  • 9
  • 56
  • 103
Bernd
  • 189
  • 9
  • Not sure what the problem could be. Sounds like a more general iCloud issue, rather than related purely to Ensembles. I guess you are certain that the issue is caused by the URL method returning `nil`, right? Or is that perhaps a false assumption? – Drew McCormack Jul 23 '15 at 07:14
  • Yes, I am quite sure. I have debugged it and the UbiquityID is returned, but for the container nil is returned. And YES, I DO think too, that it's NOT an Ensembles issue, because Ensembles works quite fine for the iOS apps. But I hoped, you were asked such a thing that often, that you could say: Yes, for the Idiomatic-Mac-App you surely have forgotten to xxx or yyy! – Bernd Jul 23 '15 at 13:26
  • I guess in the iCloud Drive settings the app has been given permission to use the drive, right? I think the user can turn that off and on for each app. Did you be sure to change the iCloud container id and setup that container on the Apple site? – Drew McCormack Jul 23 '15 at 13:54
  • The iCloud Drive settings app? If you mean the MacOS-iCloud-System-Settings and there the iCloudDrive area, then yes, I enabled the Idiomatic app there. And I also created the iCloud container and allowed access for the App-ID in the DeveloperCenter/ on Apple's servers. – Bernd Jul 24 '15 at 07:22

1 Answers1

0

Ok, for quite some time, I didn't have that error again on my Mac and wanted to share, that I have NOT found out, WHAT caused this iCloud syncing error, but that it worked now for weeks, AFTER I restored my ~/Library folder again.

So, my best guess for solving this error of mine: Do TimeMachine Backups and do NOT manually delete things under ~/Library without such a backup!!!

Bernd
  • 189
  • 9