This is a simple way to get started building an app with React Native and Meteor. It is opinionated to make it easy for people to start but if you have your own way of doing things it's very easy to swap things out and move them around however you see fit.
As it currently stands this project is only focused on configuring the React Native project. The Meteor side is up to you. For thoughts on how to structure your Meteor App I would suggest you read the Meteor Guide and the Mantra spec.
You can checkout a very quick walkthrough of the project here.
git clone https://github.com/spencercarli/react-native-meteor-boilerplate.git
MeteorApp
directory run meteor npm install
RNApp
directory run npm install
Note: You must be on a Mac for this.
MeteorApp
directory, type meteor
You've got a few ways you can run the app for iOS:
RNApp
directory run react-native run-ios
Note: You must be on a Mac for this.
MeteorApp
directory, type meteor
ipconfig getifaddr en1
to do so)RNApp/app/config/settings.js
change localhost
to your machine's IP addressFor further information please reference the official docs.
MeteorApp
directory, type meteor
RNApp/app/config/settings.js
change localhost
to your machine's IP addressRNApp
directory run react-native run-android
On OSX you can get your IP address by running ipconfig getifaddr en1
in a terminal window.
On linux running ifconfig
will get you a list of your network interfaces along with their IP addresses. For the stock Google simulator you will want to use the IP of your active network connection (probably eth0
or wlan0
). If you are using the Genymotion simulator, it runs in a Virtual Box VM with a Host-only network interface. You will want to use the IP address of this network which may look like vboxnet0 under ifconfig.
MeteorApp
directory, type meteor
adb devices
to make sure your device shows upadb reverse tcp:8081 tcp:8081
RNApp/app/config/settings.js
change localhost
in METEOR_URL
to your computer's IP address (see note in "Running on Android" section on how to get your IP Address)react-native run-android
For further information please reference the official docs.
Configure how the device will connect to the meteor server. See running android on a device to pick from the options.
Plug in your device and use lusb to find the first 4 digits of your device ID.
lsusb Bus 001 Device 003: ID 04e8:2e76 Motorola PCS
Enter this in udev rules. In the example we are copying over 04e8
echo SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666", GROUP="plugdev" | sudo tee /etc/udev/rules.d/51-android-usb.rules
Check that your device is properly connecting to ADB, the Android Debug Bridge, by using:
adb devices
Note: You should have only one active ADB connection. If you have a simulator running you should close it before proceeding.
These steps are abstracted from the pages running on device selecting the Linux Tab.
If you have any questions please open an issue. Thanks!