i am trying to create subscriptions but i see some weird error popping out.
I have tried to search google and stackoverflow without any luck
Can someone help me please?
Code is the following
func SottoscrizioneAccessori()->Void
{
if UserDefaults.standard.bool(forKey: "SUBACCESSORI_\(Manager.AI.StatoAttuale.NodoAI.PIVA)") == false
{
let predicate=NSPredicate(format: "RefAzienda = %@", Manager.AI.StatoAttuale.NodoAI.PIVA)
let subscription=CKQuerySubscription(recordType: "CKAccessori",
predicate:predicate,
subscriptionID: "CKSUBACCESSORI",
options: [.firesOnRecordUpdate, .firesOnRecordCreation])
let nInfo=CKNotificationInfo()
nInfo.alertBody = "Accessori Aggiornati"
nInfo.shouldBadge=false
subscription.notificationInfo = nInfo
Manager.AI.pubDB.save(subscription, completionHandler: { (retRecord, error) in
if error != nil
{
print("SUB_ACCESSORI - sottoscrizione fallita con errore \(error?.localizedDescription ?? "-err-")")
}
else
{
print("SUB_ACCESSORI - sottoscrizione creata con successo")
UserDefaults.standard.set(true, forKey: "SUBACCESSORI_\(Manager.AI.StatoAttuale.NodoAI.PIVA)")
}
})
}
}
the database is the development one (tried also to force the production one and the error was that i cannot create subscription on production container
The error in the console is:
SUB_ACCESSORI - sottoscrizione fallita con errore Error saving record subscription with id CKSUBACCESSORI to server: Deployed schema UUID does not match supplied parent UUID.
the development database is already deployed in production... everything is "correct" (name of recordtype, fields, etc.etc.)...
i am not able to find this kind of error anywhere...
someone?