Create custom zone in private database when deploying an app?

since CKDatabaseSubscription currently doesn't work for the default zone.

Can I create custom zone in private database when deploying an app?

I don't want the app code to check the existence of a custom zone, and if not create it every time it starts.

I'd rather do it at the deployment pharse, can Apple do that way?

It's been awhile since I did this - but I think you can use one or another type of subscription in the public database default zone.


You cannot create a custom zone in everyone's private database on deployment. You can only create a custom zone in your private database on deployment. Each user of your app will have their own private database and will need to create their own custom zone when they launch your app.

The app was designed to use private database.

Do you mean each user of the app have to create their own custom zone and schema while the app was first launching?

like, if not existed zone1 then create zone1. if not existed recType1 then create recType1.

Yes.

is there any script similar to SQL to pass to iCloud to do this? (if zone/table not existed, create it).

Or I have to code it manually with lots of Swift code?

In your app you can create zones in the users' private database as you require. If you want to store your Banana objects in a "Fruit" zone, you just create the Fruit zone yourself.

But you have to do it in the app. You cannot create it in the CloudKit Dashboard.

>is there any script similar to SQL to pass to iCloud to do this?

No


>Or I have to code it manually with lots of Swift code?


Yes, but it does not take a lot of code. You can do it in Swift or Objective C

Create custom zone in private database when deploying an app?
 
 
Q