Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
365 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 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...