在不需要iCloud登录的情况下播种并维护CloudKit公共数据库? [英] Seed and maintain CloudKit public database without requiring iCloud login?

查看:143
本文介绍了在不需要iCloud登录的情况下播种并维护CloudKit公共数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Apple文档说,在没有iCloud登录的情况下,可能会从应用程序的CloudKit公共数据库进行读取,但写入不会发生。将记录保存或更新到公共数据库需要iCloud登录。

The Apple docs say reads from an app's CloudKit public database can occur without an iCloud login, but writes cannot. Saving or updating records to the public database require an iCloud login.

如果您想播种并维护公共数据库作为管理员怎么办?例如,对于一个地图应用程序,如果您作为管理员想用每个国家的人口统计数据填充并维护公共数据库,您的流程是否仍需要iCloud登录?

What if you want to seed and maintain the public database as an administrator? For instance, for a map app, if you as an administrator want to populate and maintain the public database with demographic data for each country, does your flow still require an iCloud login?

如果要发布代码段,则首选Swift。谢谢。

If posting code snippets, Swift is preferred. Thanks.

推荐答案

问题的答案在云仪表板上。

The answer to your question is on the cloud dashboard.

这是您正在查看的公共数据库的权限,您可以将其设为可写这里是经过身份验证的帐户,因此有人使用其iCloud帐户登录,但是没有选择使其可以匿名写入。

This is the permissions for public database your looking at, you can make it writable as I have here for an authenticated account, so somebody logged in with their iCloud account, but there is no option to make it writable anonymously.

但是我可以在这里看到混乱之处,数据库属于应用程序,而不是用户,您可以像我在这里那样使任何人都可以写入公共部分。因此,在您的示例中,您的地图应用会将其写入其公共数据库,以便其他用户可以访问它。

But I can see the confusion here, the database belongs to the app, not the user and you can make the public part writable by anybody as I have here. So in your example your maps app it would write to its public database so that other users would have access to it.

您需要注意的是,公共数据库的配额与应用程序的所有者(您自己)有关。因此,您不想在其中放置太多数据,也不希望确实向经过身份验证的用户提供上传重物的能力,因为如果这样做,您可能会对财务状况感到困惑。您有一个配额,加入的用户越多,配额就越大,但是在现实世界中如何实现配额是管理上的挑战。

The caveat you need take care of here is the fact that the quota for the public database goes with the app's owner, you. So you don't want to put too much data there or indeed give even authenticated users the ability to upload heavy objects, cause if you do you may come unstuck with the finances. You have a quota, which gets bigger the more users you bring on board, but how that works out in the real world is a challenge to manage.

这篇关于在不需要iCloud登录的情况下播种并维护CloudKit公共数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆