Search code examples
iositunesgame-centercloudkit

Retrieve the user's App Store nickname programmatically


Is anyone aware of a method to get the user's App Store nickname? I know about the CloudKit method fetchUserRecordIDWithCompletionHandler, but this returns the user first and last name, not the nickname that the user uses to e.g. write reviews on iTunes. Thanks


Solution

  • Using fetchUserRecordIDWithCompletionHandler and discoverUserInfoWithUserRecordID is the only way to get information about the current iCloud user.

    Besides that you do have to be aware that starting from iOS 9 you wont't get the first and last name anymore only a displayname. For more info see https://developer.apple.com/library/prerelease/ios/documentation/CloudKit/Reference/CKDiscoveredUserInfo_class/index.html#//apple_ref/swift/cl/c:objc(cs)CKDiscoveredUserInfo