简体   繁体   English

Realm swift 同步本地数据库?

[英]Realm swift sync local database?

I'm using Realm in my app to store user-created data.我在我的应用程序中使用Realm来存储用户创建的数据。 Now I want to sync local database so that user can use same data in other iOS devices.现在我想同步本地数据库,以便用户可以在其他 iOS 设备中使用相同的数据。 I found that realm support data sync on Realm Object Server .我发现该领域支持Realm Object Server上的数据同步。 But couldn't understand how it will work?但无法理解它将如何工作? or what I need to change in my existing code to enable data sync?或者我需要在现有代码中更改什么才能启用数据同步?

Note: I'm using Swift 2.3 and Realm 1.0.2 (Yes, it is an old project).注意:我使用的是Swift 2.3Realm 1.0.2 (是的,这是一个旧项目)。

You can use the Realm Mobile Platform to sync your database however right now you must setup RMP and the Realm Object Server on your own server (or Mac/Linux computer).您可以使用 Realm 移动平台来同步您的数据库,但是现在您必须在您自己的服务器(或 Mac/Linux 计算机)上设置 RMP 和 Realm 对象服务器。 You will need to upgrade the version of Realm that you're using to the latest version so you can access the APIs included for the sync component.您需要将您使用的 Realm 版本升级到最新版本,以便您可以访问包含在同步组件中的 API。 However, once that upgrade has been completed, no Realm database code will need to be changed to make use of sync or ROS.但是,一旦升级完成,就不需要更改 Realm 数据库代码来使用同步或 ROS。

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

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