iOS9 deprecates user info features for CloudKit and ABPerson.
e.g. in the properties of CKDiscoveredUserInfo
firstName" Deprecated in iOS 9.0
lastName" Deprecated in iOS 9.0
I want last name and first name as previously provided in iOS8 CloudKit.
How to retrieve the similar information in iOS9 CloudKit, ABPerson or something else?
[[UIDevice currentDevice] name];
NSArray *nameArray = [[NSHost currentHost] names];
NSString *user = [nameArray objectAtIndex:0];
Both print e.g. John'iPhone.
In the documentation for CKDiscoverAllContactsOperation you can see this:
When looking in the CloudKit dashboard, you can see that there is also no name in the User table. So you can also not fetch it.
I assume Apple is making the service anonymous. You have to implement something yourself to attach a name to an id. As you described you can use the device name or you can let the user itself enter his name.
My first idea was to implement this by first querying all contacts using ABAddressBookCopyArrayOfAllPeople and then looking up all emails using CKDiscoverUserInfosOperation for each email. but apparently that one was also discontinued in iOS 9.
It looks like Apple is stopping access to all personal data. when you go to the prerelease library and filter for address you will still see a lot of references. But as soon as you go to a detail page, you will only see everything is deprecated.