I have played around with Realm, got it to work with React-Native - Got the data inserted from JSON file and was able to filter/read it too.
Now the real question, how can i pre-package the data with my react-native app. I have seen some questions, where it is mentioned on how to do it with Native (IOS) and (Android)
I wanted to check if there is a direct way to do it with React-Native, may be a bridge someone created?
Thanks!
Ideally you would be able to just use the path of your bundled realm file when opening the Realm. Unfortunately this will not work until support for read-only realms is added. I created an issue to track this: https://github.com/realm/realm-js/issues/392
Until read-only realms are supported, you can copy the bundled realm file into your Documents directory at app launch in your AppDelegate and then use that path to access the bundled Realm. Relative paths are supported so if you copy your file to <Documents>/bundled.realm
you can open this file by just passing in the file name, ie new Realm({path: 'bundled.realm'})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With