if anyone could help I am beyond frustrated with an issue being experienced with Appple’s cloud kit dashboard
I keep receiving the following error after creating a subscription to the public database:
Expected this response but could not parse it: HTTP 200, text: {"subscriptions":[{"type":"query","subscriptionId":"E38D14D7-4864-45E7-943C-5BF0307B16E4","query":{"recordType":"Documents","filters":[{"fieldName":"AssetName","fieldValue":{"type":"stringType","value":""},"type":"NOT_EQUALS"}]},"firesOn":["CREATE"],"firesOnce":false,"zone":
the code used to create the subscription is as follows:
let predicate = NSPredicate(format: "AssetName != %@", "")
let subscription = CKQuerySubscription(recordType: "Documents", predicate: predicate, options: .firesOnRecordCreation)
let notification = CKSubscription.NotificationInfo()
notification.soundName = "default"
notification.title = "Title"
notification.titleLocalizationArgs = ["AssetName"]
notification.titleLocalizationKey = "AssetName"
notification.subtitle = "Subtitle"
notification.subtitleLocalizationArgs = ["AssetName"]
notification.alertBody = "New document created."
notification.alertLocalizationArgs = ["AssetName"]
subscription.notificationInfo = notification
CKContainer.default().publicCloudDatabase.save(subscription) { result, error in
if error != nil {
print(error!.localizedDescription)
} else {
print(subscription)
}
}
Any assistance, would be greatly appreciated.
2
Answers
Apparently this issue has been happening for lots of people. It’ most likely a server-side error. Check this link.
I was running into this issue as well. Everything is working now though. The Cloudkit dashboard has some aesthetic changes so I’m assuming a fix was pushed out along with that latest update.