Search code examples
objective-cxcodeicloudcloudkit

Use "iCloud" badge to Login to CloudKit


I'd like to use the following badge that the users can log in via iCloud. Where can I find it? Is it an official badge? How do I implement it? enter image description here

Thank You!


Solution

  • You will get a system prompt the moment you try to get the user info when you do a fetchUserRecordIDWithCompletionHandler on a CloudKit container. The badge above should then just be some custom button. On press you will do the fetchUserRecordIDWithCompletionHandler and save the user RecordID somewhere in your app so that you know that the user is logged in.