CloudKit Share Participant no longer returns name

I'm working on an app that uses CloudKit sharing functionality. The sharing features have been working great, but recently I no longer get the user names back from the

CKShare.Participant
when a user accepts the sharing request.


Details

I'm using the built-in

UICloudSharingController
to set up the share, which works and sets up the share properly.


When the invited user accepts the share, the owner gets a notification of the change in the zone and then fetches the

CKShare
.

The fetched

CKShare
object has an array of share participants (
CKShare.Participant
), which has a
nameComponents
property. I've used this in order to get the first and last name of the participants to display in the UI. This was all working fine until recently.


Now, however, I'm only getting values in

nameComponents
for the owner of the share. The accepted participants have
nil
values for the
nameComponents.givenName
and
nameComponents.familyName
.


I have not changed anything in this part of my code in some time, so don't think I've caused this. I've tried this on iOS 11, 11.4, 12, 12.1 and all have the issue. This leads me to believe there might have been a change on the server side from Apple.


Note I am not requesting

.userDiscoverability
permissions. I have not had to do that in order to get the names once a user accepts. I realize that I can request that and then use
CKDiscoverUserIdentitiesOperation
to get the names. But I'd rather not as I don't want the dialog, which is confusing for users.


Has anyone seen this change? Or better, yet, does anyone have any suggestions for tracking down the cause or fixing it?


Thanks.

Replies

Sounds like a new entitlement might be involved. I've had things working fine in the past and then mysteriously not working fine and found that it was because a new entitlement had been introduced. Maybe check CKError.missingEntitlement?


https://developer.apple.com/documentation/cloudkit/ckerror/2325206-missingentitlement

Thanks. I’ve checked for entitlement issues, but there are none. I also verified that this happens both in the production environment as well as the development environment.


I’ve submitted a bug with Apple and will post back with any information I receive.

Did you ever figure this out? Seeing a similar problem and can't really understand why!

No I haven't. I believe it's just a change Apple made related to privacy. I guess since the user hasn't explicitly granted permission, as they do with

CKDiscoverUserIdentitiesOperation
we no longer get the name. I do wish Apple would at least document these changes so we know what's going on.


I added a user name feature to my app where I explicitly ask the user for their name. Not ideal, but I still think it's better than the default dialog a user sees with

CKDiscoverUserIdentitiesOperation.