Cordova 插件不保存到 iCloud

Cordova plugin not saving to iCloud

我将 Ionic 与以下插件一起使用:cordova-plugin-icloudkv 在 Apples iCloud.

中保存数据

我叫:

sync(successCallback/*(dictionary_with_all_sync_keys)

然后:

save(key, value, successCallback)

保存,即我可以通过以下方式再次访问它:

load(key, successCallback/*(value)*/, failCallback)

并按预期获取保存的值。

问题

当我关闭应用程序并重新启动它并尝试:

sync(successCallback/*(dictionary_with_all_sync_keys)

然后:

load(key, successCallback/*(value)*/, failCallback)

我得到:

key is missing

就好像,该值没有被持久化到 iCloud,而只是本地存储,当应用程序关闭时它会丢失。

问题

如何让上面的内容持续到 iCloud

谢谢

我想您可能需要在 official link

中再次阅读插件用法

声明如下,

Reminder: Calling sync does not guarantee (or matter for) syncrhonization with iCloud but only between the in-memory and the flash storage that will be eventually synced with iCloud by an independent agent.

所以同步实际上取决于独立代理。此插件仅推送可用于同步的数据。希望对你有帮助