I was hoping for an update of SwiftData which adopted the use of shared and public CloudKit containers, in the same way it does for the private CloudKit container.
So firstly, a big request to any Apple devs reading, for this to be a thing!
Secondly, what would be a sensible way of adding a shared container in CloudKit to an existing app that is already using SwiftData?
Would it be possible to use the new DataStore method to manage CloudKit syncing with a public or shared container?
Post
Replies
Boosts
Views
Activity
I'm continually getting an error with a new CloudKit container when I try to save data.
error: Couldn't get container configuration from the server for container "iCloud.com.***.***"
here's the class:
private var db = CKContainer(identifier: "iCloud.com.***.***").privateCloudDatabase
func addTask(taskItem: TaskItem) async throws {
checkStatus()
do {
try await db.save(taskItem.record)
} catch {
print("error: \(error.localizedDescription)")
}
}
func checkStatus() {
let id = CKContainer(identifier: "iCloud.com.***.***").containerIdentifier
print(id ?? "unknown")
Task {
let status = try await CKContainer(identifier: "iCloud.com.***.***").accountStatus()
switch status {
case .available:
print("available")
case .noAccount:
print("no account")
case .restricted:
print("restricted")
case .couldNotDetermine:
print("could not determine")
case .temporarilyUnavailable:
print("temporarily unavailable")
@unknown default: break
}
}
}
The account status reports as available but gives the error on an attempt to save.. I'm trying to work out what I might be doing wrong..
Hello,
I am using SubscriptionStoreViews to list 2 subscriptions, both in the same group.. a monthly subscription and a six monthly subscription. Both work and appear in the list presented by SubscriptionStoreView.
However when I go to AppStore Connect and select the six monthly subscription to be a promoted subscription, it can now be selected and purchased on the AppStore but no longer appears in my SubscriptionStorekit View.
Is this expected behaviour and should I create a duplicate six month subscription which is not promoted, or is there a better solution?
Many thanks