I'm trying to subscribe to push notifications using CloudKit. I'm getting this error:
<CKError 0x170c5b1e0: "Unknown Item" (11/2003); server message = "could not find required field fieldID="25""
from this code:
let subscription = CKSubscription(recordType: "PlayerData", predicate: NSPredicate(format: "TRUEPREDICATE"), options: CKSubscriptionOptions.FiresOnRecordCreation)
let notificationInfo = CKNotificationInfo()
notificationInfo.shouldBadge = false
subscription.notificationInfo = notificationInfo
PublicDb.saveSubscription(subscription, completionHandler: { (returnedSubscription: CKSubscription!, error: NSError!) in
println("\(error)")
})
But I don't have a field called "fieldID" nor I have any kind of reference to it in my entire project. I don't know where the 25 comes from either. It still happens if I change my record type and/or NSPredicate.
I also tried setting this but nothing
notificationInfo.shouldSendContentAvailable = true
This used to work for me, but now I cannot make it work anymore. Seems like my database got corrupted somewhere. I tried deleting the record type and recreating but no luck.
Fixed it by resetting the development environment. Hopefully same thing doesn't happen on prod.
This same thing just happened to me. I don't think fieldID is due to someone else's database, but rather part of Apples underlying database structure. Unfortunately that read-out gives us developers zero information. The resetting of the development environment fixed my issue as well. Worth noting that this happened after changing the attribute type of a record that was specifically being referenced in a subscription. I had kept the attribute name but changed its type.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With