Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
364 views
in Technique[技术] by (71.8m points)

ios - Seed and maintain CloudKit public database without requiring iCloud login?

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.

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?

If posting code snippets, Swift is preferred. Thanks.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The answer to your question is on the cloud dashboard.

CloudKit dashboard snapshot showing permissions

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.9k users

...