Is there a way to pre-create a Realm database (default.Realm) via React-Native (JS)

I played with Realm, got it to work with React-Native - got the data inserted from the JSON file, and was able to filter and read it.

Now the real question is, how can I pre-pack the data using my adaptive application. I saw several questions mentioning how to do this with Native (IOS) and (Android)

I wanted to check if there is a direct way to do this with React-Native, maybe someone created a bridge?

Thanks!

+6
source share
1 answer

Ideally, you can simply use the path to your federated area file when you open the kingdom. Unfortunately, this will not work until read-only support is added. I created a problem to track this: https://github.com/realm/realm-js/issues/392

Until read-only capabilities are supported, you can copy the associated area file to your document directory when you launch the application in AppDelegate, and then use this path to access the united kingdom. Relative paths are supported, so if you copy the file to <Documents>/bundled.realm , you can open this file simply by passing the file name, that is, new Realm({path: 'bundled.realm'})

+1
source

All Articles