强制iOSCloudKit同步更新下载所有记录到本地设备
Force iOS CloudKit synchronization update to download all records to local device
我的应用程序在 iPhone 上本地维护一个文件列表。启用 CloudKit 后,这些文件会自动同步到 CloudKit 数据库。
删除应用程序时,所有本地数据也将被删除。我想看看是否可以触发 CloudKit 通知 CKNotification,特别是 CKQueryNotificationReasonRecordCreated,以便可以重新同步和重新下载我的所有本地记录。
我目前有一个功能,它监听App delegate的didReceiveRemoteNotification,然后下载相应的记录。但是,为此,我需要 post "fake" 更新,以便 CloudKit post 通知它在本地下载到另一台设备。
我不想 post 为每条记录进行虚假更新,并希望从 CloudKit.
批量下载到本地设备
谢谢。
我建议您只使用 CKQuery
并使用给定的 NSPredicate
您将能够从 CloudKit 数据库
中获取所需的所有数据
我的应用程序在 iPhone 上本地维护一个文件列表。启用 CloudKit 后,这些文件会自动同步到 CloudKit 数据库。
删除应用程序时,所有本地数据也将被删除。我想看看是否可以触发 CloudKit 通知 CKNotification,特别是 CKQueryNotificationReasonRecordCreated,以便可以重新同步和重新下载我的所有本地记录。
我目前有一个功能,它监听App delegate的didReceiveRemoteNotification,然后下载相应的记录。但是,为此,我需要 post "fake" 更新,以便 CloudKit post 通知它在本地下载到另一台设备。
我不想 post 为每条记录进行虚假更新,并希望从 CloudKit.
批量下载到本地设备谢谢。
我建议您只使用 CKQuery
并使用给定的 NSPredicate
您将能够从 CloudKit 数据库