Make sure your have enabled Push and remote notifications per the Apple Documentation
Project Settings > Signing and Capabilities
Sync CoreData with CloudKit using
try? persistentContainer.viewContext.setQueryGenerationFrom(.current)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…