简体   繁体   English

我可以将CloudKit与其他iCloud帐户一起使用吗

[英]Can i use CloudKit with different iCloud Account

I have a developer account and I'm developing an app for someone. 我有一个开发人员帐户,正在为某人开发应用程序。 I want him to be able to change datas in CloudKit so I want to use his iCloud account(He doesn't have a developer account, just personal account). 我希望他能够更改CloudKit中的数据,所以我想使用他的iCloud帐户(他没有开发人员帐户,只有个人帐户)。 However, i don't know how to differentiate my developer account and his iCloud account. 但是,我不知道如何区分我的开发人员帐户和他的iCloud帐户。

Thank You 谢谢

I believe CloudKit 's notion of public and private databases may achieve what you need to do. 我相信CloudKit的公共数据库和私有数据库的概念可能会实现您需要做的事情。 As a reference, I am referring to slide 45 in Apple's WWDC presentation on cloudkit ( http://devstreaming.apple.com/videos/wwdc/2014/208xx42tf0hw3vv/208/208_introducing_cloudkit.pdf ) 作为参考,我指的是Apple在Cloudkit上的WWDC演示文稿中的幻灯片45( http://devstreaming.apple.com/videos/wwdc/2014/208xx42tf0hw3vv/208/208_introducing_cloudkit.pdf

Considering that each app has a container, and that container includes 1 public database (that all users of the app can access) plus a multitude of private databases (one per user), if the data you're storing isn't private, then consider storing it in the public database. 考虑到每个应用程序都有一个容器,并且该容器包含1个公共数据库(该应用程序的所有用户都可以访问)和多个私有数据库(每个用户一个),如果您存储的数据不是私有的,则考虑将其存储在公共数据库中。 You can modify it as needed during development by being logged into your iCloud account, and your client can modify it as well by being logged into his iCloud account. 您可以登录到iCloud帐户,根据需要在开发过程中对其进行修改,而客户端也可以通过登录其iCloud帐户来对其进行修改。 (Apple docs say the public database is stored in the App developer's iCloud space) (Apple文档说公共数据库存储在App开发人员的iCloud空间中)

If you store the data in the private database, however, it will be written to an instance of the private database belonging to the currently signed-in user. 但是,如果将数据存储在私有数据库中,则将数据写入属于当前登录用户的私有数据库的实例。 So anything you write would go into a private database instance (which Apple docs says resides in each user's personal iCloud space) and anything he writes would go into his private database instance. 因此,您编写的任何内容都将进入一个私有数据库实例(Apple文档称其驻留在每个用户的个人iCloud空间中),而他编写的所有内容都将进入其私有数据库实例。 Until recently, that was the end of the story. 直到最近,故事还没有结束。 However, now, cloudKit supports CKShare which, in a nutshell, allows a user to grant access to specific shared items inside their private db. 但是,现在, cloudKit支持CKShare ,简而言之,它允许用户授予对其私有数据库中特定共享项的访问权限。 So you could still write the data to a private DB but allow access via a CKshare . 因此,您仍然可以将数据写入私有DB,但允许通过CKshare访问。

Finally, there's another option, but I don't recommend it. 最后,还有另一种选择,但我不建议这样做。 In the device settings, you can log out of iCloud and log back in as another user. 在设备设置中,您可以注销iCloud并以其他用户身份重新登录。 In which, you're still developing on your device, but you're logged into iCloud as your client. 在其中,您仍在设备上进行开发,但是您已作为客户端登录到iCloud。 This has many drawbacks, though. 但是,这有很多缺点。 First and foremost, credential sharing is always a bad security practice. 首先,凭据共享始终是不良的安全实践。 But, probably a more immediate consequence will be your device will no longer be sharing with/backing up to your iCloud account, but instead with the client's. 但是,可能更直接的后果是您的设备将不再与共享或备份到您的iCloud帐户共享,而是与客户端共享。

It's hard to give more specific advice without better understanding the scenarios you're implementing. 如果不更好地了解您正在实施的方案,就很难给出更具体的建议。

** update based on OP's comment ** ** 根据OP的评论进行更新 **

I see now. 我现在明白了。 Using the development cloudkit dashboard probably isn't going to work. 使用开发cloudkit仪表板可能无法正常工作。 AFAIK, you must log in with a development account, not just an iCloud account, to use the cloudkit dashboard. AFAIK,您必须使用开发帐户(而不仅仅是iCloud帐户)登录才能使用cloudkit仪表板。 So your client won't be able to get in at all, anyway. 因此,无论如何,您的客户将根本无法介入。 You could add your client's email address as a member of your development team, which will let them log into your cloudkit dashboard; 您可以将客户的电子邮件地址添加为开发团队的成员,这将使他们登录到您的cloudkit仪表板; however, that also gives them access into portions of your iTunesConnect as well. 但是,这也使他们能够访问iTunesConnect的某些部分。 And, it really won't scale to support additional users of your app. 而且,它确实无法扩展以支持您的应用程序的其他用户。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM