I am trying to subscribe to push notifications using CloudKit. I get 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", and I don’t have a link to it in my whole project. I don’t know where 25 comes from. This happens if I change my record type and / or NSPredicate.
I also tried to fix this, but nothing
notificationInfo.shouldSendContentAvailable = true
This worked for me, but now I can no longer work. It looks like my database is messed up somewhere. I tried to delete the record type and recreate, but no luck.
source share