Skip to content
React-native realm预置
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
android
ios
realm
.babelrc
.buckconfig
.flowconfig
.gitattributes
.gitignore
.watchmanconfig
App.js
README.md
app.json
index.js
package-lock.json
package.json
yarn.lock

README.md

realm 数据预加载

Require Env:
npm i realm
npm i react-native-fs
react-native link 

分别拷贝数据库至原生公用目录

Android端

android/app/src/main/assets/demo.realm

IOS端

Build Phases->Copy Bundle Resources->demo.realm

前端

执行Realm 提供的copyBundledRealmFiles,可以将共用的数据库文件拷贝至应用安装的Documents目录.

Realm.copyBundledRealmFiles();

实例
prepare-realm-data-demo
You can’t perform that action at this time.