After doing that step I was happy and tired and didn’t add that key into the info.plist again before going on vacation. Bad move. I spent an hour figuring out why my app wouldn’t start when running react-native run-ios. Instead i got the error No bundle URL Present..
By adding the following to info.plist it started to work again:
However this is not the only thing that could produce this error. Checkout this Github issue if the solution above does not help.
There are some steps that need to be taken in order to publish a React Native app to the iOS App Store. But first you need to know how to submit a native app to the app store. That is out of scope for this tutorial since there is a tutorial at Ray Wenderlich that covers that whole process. It helps you with setting up a developer account, create certificates and profiles and so on. After finishing those steps you can continue reading below.
1. Remove localhost from info.plist
First we need to remove the localhost exception from info.plist. By default all traffic over HTTP is rejected since iOS 9 with App Transport Security. React Native has added an exception to localhost to make development easier.
Open info.plist and expand the App Transport Security settings and Exception Domains. Under there you’ll find the localhost entry. Remove it.
Info plist - App Transport Security settings
2. Create a release scheme
When building an app for release the React Native Developer Menu will be disabled.
React Native Developer menu - borrowed from official docs
Go to Product -> Scheme -> Edit Scheme in XCode. Select Run tab and set the Build Configuration dropdown to Release.
XCode release scheme
3. Build app with release scheme
Select Product -> Build from XCode or build the app from the command line using this command:
I’m interested in trying React native instead of Ionic for Dogwalk. And when doing this i’ll be writing the steps I take if someone else is interested in learning this as well. Now we’ll take a look on how to install React Native.
For React Native we need node, Watchman, React Native CLI and Xcode. Watchman is a service for watching changes in files and trigger actions when that happens. Reactive CLI is the command interface for React Native. Xcode is Apples IDE.
When running git rebase you reapply commits on top of another base tip. Ok, nice what does that mean? The official git docs provides a good explanation of this.
If we have a feature branch called topic created from master at commit E. And if master has new commits before our branches can look like this:
To rebase this branch with master we would use this command:
Our branches would then look like this:
Git rebase interactive
We can also use rebase to, for example, squash or fixup commits that that fits better into an already made commit. This would come in handy after a code review is done and there are changes that fit in other commits.
Say i have this line added to my new feature branch:
And this line was commited with the message First commit of this new feature
After a code review a new line was added to that file, and a new commit was created
This commit got the message Fixing a code review.
To keep the branch nice and tidy you can squash or fixup these two commits into one.
I would get the following view in my terminal:
When typing fixup before the code review commit and saving, the commit will meld into the previous commit.
Do git rebase, sqash and fixups with a GUI
You do not need to do this in the terminal if you do not want to. You can use for example GitUp
GitUp Squash and fixups
If you right-click on a commit you get a lot of options for example Fixup with Parent and Squash with parent. But you also have the oiption to Swap with parent (Move down) and Swap with Child (Move up) which you can use before squashing or fixuping if there are other commits between the ones you want to combine.
To complement GitUp you can use the GitHub desktop app to see what your commits contains and which ones should be melded together.
push and pull after rebase
I work with github as an origin to this repo. To push the repo now when you have done a rebase you need to force the push:
For other users that now want to continue to work on this branch they now need to do a: