I'm trying to create a basic iOS-app based on ReactNative using Electrode (Walmart - http://www.electrode.io/site/docs/introduction.html)
While I can get the app to work locally on my Mac, I'm struggling to understand how the whole Over-The-Air (OTA) update can/should work.
Here's what I've done so far
But when I run the app using ern run-ios, it still seems to point towards my local machine (I can update the index-ios.js-file and it updates in the app). So what is lacking for getting the whole OTA-setup going where another programmer can updates the index-ios.js-file in the cloud/bitbucket (I'm guessing) and update the app on the fly?
I ended up getting it to work on a 2nd try - The notes I've made underways is the following:
I searched around the net and used a bit here and there, so can't really point you to one simple guide..
PreRequisites
install Homebrew
install ReactNative-cli-tools and codePush
brew install node
brew install watchman
npm install -g react-native-cli
Npm install -g code-push-cli
codePush register
Code-push register
(complete registration, validate by running this command again and it should say: [Error] You are already logged in from this machine.)
App
react-native init [AppName] Cd [AppName] npm install —save react-native-code-push Npm install (something goes wrong when installing code-push, so we have to reinstall some react-native elements)
code-push app add ReactApp ios react-native (Copy production deployment key)
React-native link react-native-code-push (Enter production deployment key)
Edit App.js
import codePush from 'react-native-code-push'
(Remove "export default" from main App class)
const codePushOptions = {
checkFrequency: codePush.CheckFrequency.ON_APP_RESUME,
installMode: codePush.InstallMode.IMMEDIATE
}
export default codePush(codePushOptions)(App);
release app to codePush server
code-push release-react ReactApp ios --deploymentName Production
command to see current status of reactApp codePush server
code-push deployment ls ReactApp -k
Open xCode project in \ios-folder
Set up signing if needed
edit xCode scheme to Release
edit App.js to make the change visible
Build and app-content should update after open to reflect changes made between version uploaded to codePush-server and local version