0

I am programatically creating a CKShare and sharing the URL with recipients over email; when they do this, they click on the link and the UIApplication 'userDidAcceptCloudKitShareWithMetadata' method is correctly called. I then use the CKAcceptSharesOperation to mark the share as 'accepted'.

In most cases, it's working fine, even with the app in production environment. Every now and then, a user messages that they get an error with the CKAcceptSharesOperation .. the error says something like "Couldn't get a Sharing identity set". The error in full:

CKInternalErrorDomain: 5000" UserInfo={NSUnderlyingError=0x281f8f0f0 {Error Domain=CKInternalErrorDomain Code=5000 "Couldn't get a Sharing identity set" UserInfo={CKErrorDescription=Couldn't get a Sharing identity set, NSLocalizedDescription=Couldn't get a Sharing identity set, NSUnderlyingError=0x281f8d8c0 {Error Domain=CKInternalErrorDomain Code=5000 "Couldn't create a PCS identity" UserInfo={CKErrorDescription=Couldn't create a PCS identity, NSLocalizedDescription=Couldn't create a PCS identity, NSUnderlyingError=0x281f8f570 {Error Domain=NSOSStatusErrorDomain Code=-25300 "Failed finding service Sharing" UserInfo=0x2811c1400 (not displayed)}}}}}, CKErrorDescription=Couldn't get a Sharing identity set, warningTitleKey=Accept Share Failed, NSDebugDescription=CKInternalErrorDomain: 5000, NSLocalizedDescription=There was a problem with accepting this share - Couldn't get a Sharing identity set}

I had the user check his/her iCloud account, and it seems fine. The iCloud account is new, so that might have something to do with it? If not, what else could be causing this? What can I try to isolate the issue?

Thanks.

Z S
  • 7,039
  • 12
  • 53
  • 105
  • That’s a pretty obscure error. Does the user have your app installed already when they click the share link? Do you have a fallback URL specified for the CloudKit container in the CK dashboard? Has the user actually signed in to icloud.com with their account (the account isn’t valid until they accept the terms and conditions). I’d try those things and see if it reveals any clues. – Clifton Labrum Nov 10 '18 at 06:58
  • Thanks. It turns out it was because the user hadn't logged into iCloud.com and accepted terms and conditions. Not sure how you get into that state though ... if you create a new account, wouldn't you have to already accept "terms and conditions"? In any case, logging into the website and accepting that, and THEN also logging out of the iCloud account on device and logging back in fixed the issue. – Z S Nov 12 '18 at 17:51
  • 1
    Technically iCloud accounts are in limbo until they accept those terms. It's frustrating that Apple's APIs don't give a more specific error. – Clifton Labrum Nov 13 '18 at 21:38
  • Yep; even sharing through Apple's Notes app won't work and give a vague error. – Z S Nov 13 '18 at 22:08

1 Answers1

0

It turns out the error was because the user hadn't accepted terms and conditions. The user should log into iCloud.com ... the website might prompt for setting up security questions and/or accepting Terms & Conditions. The user also might have to log out of the iCloud account on device and log back in. That should fix the issue.

Z S
  • 7,039
  • 12
  • 53
  • 105