简体   繁体   English

在iPad和iPhone之间同步处理Phonegap应用程序数据

[英]Synchonising Phonegap app data between ipad and iphone

I have a Phonegap app on the App Store. 我在App Store上有一个Phonegap应用。 I am very confused as to how to allow the following senario - a user has a copy of the app on his ipad, he writes to the sqlite database, these changes to the database are synchronised with his copy of the app on his iphone. 我对如何允许以下感觉非常困惑-用户在其iPad上拥有该应用程序的副本,他写入sqlite数据库,这些对数据库的更改与他在iPhone上的应用程序副本同步。

Looking at the Phonegap documentation - I can set 查看Phonegap文档-我可以设置

preference name="BackupWebStorage" value="cloud" 首选项name =“ BackupWebStorage” value =“ cloud”

in config.xml - so this backs up the database to icloud. 在config.xml中-因此这会将数据库备份到icloud。 Is this all I need to achieve what I am after? 这是我所追求的一切吗?

Quoting the Phonegap documentation here, 在这里引用Phonegap文档,

j. 学家 BackupWebStorage (string, defaults to 'cloud') - valid values are 'none', 'cloud' and 'local'. BackupWebStorage(字符串,默认为“ cloud”)-有效值为“ none”,“ cloud”和“ local”。 Set to 'cloud' to allow the web storage data to be backed up to iCloud, and set to 'local' to only allow local backups (iTunes sync). 设置为“云”以允许将网络存储数据备份到iCloud,并设置为“本地”以仅允许本地备份(iTunes同步)。 Set to 'none' to not allow any backups of web storage. 设置为“无”将不允许任何Web存储备份。

So specifying value="cloud" in the config.xml allows iOS to back up files from the documents directory to iCloud. 因此,在config.xml中指定value =“ cloud”可以使iOS将文件从文档目录备份到iCloud。 It is the developers duty to fetch back any information from iCloud that was backed up from an earlier or another installation. 开发人员有责任从iCloud取回从较早安装或其他安装备份的任何信息。 See this . 看到这个

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM