realm-js/README.md

26 lines
2.0 KiB
Markdown
Raw Normal View History

2015-08-13 17:29:37 +00:00
# RealmJS
2015-10-27 21:40:45 +00:00
Realm is a mobile database that runs directly inside phones, tablets or wearables. This repository holds the source code for Realm's JavaScript bindings for integrating with mobile apps built using ReactNative and PhoneGap.
2015-08-13 17:29:37 +00:00
2015-10-27 21:41:07 +00:00
## Setup
2015-10-27 21:40:45 +00:00
This repository uses submodules so you need to run `git submodule update --init --recursive` in the realm-js root directory before running any examples or including the project in your app.
2015-10-20 22:41:22 +00:00
2015-08-13 17:39:51 +00:00
## ReactNative Example
2015-10-27 21:40:45 +00:00
Make sure your environment is set up to run react native applications. Follow the instructions here https://facebook.github.io/react-native/docs/getting-started.html.
2015-08-24 16:26:51 +00:00
2015-11-02 19:30:35 +00:00
The ReactNative example project is in the `examples/ReactExample` directory. You need to run `npm install` in this directory before running the example for the first time.
2015-08-13 17:39:51 +00:00
## ReactNative Project Setup
2015-08-13 17:29:37 +00:00
- Create a new ReactNative project `react-native init <project-name>` and open the generated XCode project.
- Drag `RealmJS.xcodeproj` into the `Libraries` folder in your project.
- Drag `RealmReact.framework` from the `Products` directory under `RealmJS.xcodeproj` into the `Embedded Libraries` section in the `General` tab for your app's target settings. This bundles the library with your app.
- In the `Build Phases` tab for your app's target settings, add `RealmReact.framework` in the `Target Dependencies` and `Link Binary with Library` build phases.
- In your app's `package.json` file, add the `realm` dependency with a path to the `realm-js/lib` folder like this: `"realm": "file:path/to/realm-js/lib"` (symlinks are not yet supported by the React Native packager, see [issue #637](https://github.com/facebook/react-native/issues/637)).
- You can now `require('realm')` in your app's JS to use Realm!
2015-08-13 17:29:37 +00:00
2015-10-27 21:40:45 +00:00
## Documentation
2015-10-27 21:41:25 +00:00
Currently there is no documentation for the ReactNative apis. You can see examples of how to use the apis in the example app and in the js test files here: https://github.com/realm/realm-js/tree/master/tests
2015-10-27 21:40:45 +00:00
2015-10-27 21:40:57 +00:00
## License
2015-10-27 21:40:45 +00:00
Copyright 2015 Realm Inc - All Rights Reserved
Proprietary and Confidential