Skip to content

Instantly share code, notes, and snippets.

@codler
Last active July 17, 2017 20:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codler/7e0aaf0bba5c68a0534b35604117dbef to your computer and use it in GitHub Desktop.
Save codler/7e0aaf0bba5c68a0534b35604117dbef to your computer and use it in GitHub Desktop.

Requirements

  • node
  • npm
  • yarn

First time computer setup

brew install watchman
sudo npm install -g react-native-cli

Create project

react-native init <project-name>
cd <project-name>

Visual Studio code

code .

Add .vscode/settings.json

{
  "editor.formatOnSave": true,
  "eslint.enable": true,
  "editor.tabSize": 2,
  "editor.wordWrap": "on"
}

Eslint

yarn add --dev eslint  
yarn add --dev eslint-config-airbnb
yarn add --dev eslint-plugin-react
yarn add --dev eslint-plugin-jsx-a11y
yarn add --dev eslint-plugin-import
yarn add --dev babel-eslint

Add .eslintrc file

{
  "extends": [
    "airbnb",
    "plugin:react/recommended"
  ],
  "env": {
    "browser": true,
    "node": true
  },
  "parser": "babel-eslint",
  "plugins": [
    "react"
  ],
  "rules": {
    "max-len": 0
  }
}

Setup In app purchase

(first time) sudo npm install rnpm -g
rnpm install react-native-in-app-utils

Setup Theme

yarn add native-base
react-native link

Dom parser

yarn add https://github.com/jindw/xmldom.git#366159a76a181ce9a0d83f5dc48205686cfaf9cc

Start

react-native run-ios

Troubleshooting

Libraries in xcode are red https://stackoverflow.com/a/45120593/304894 , or boost.c are not compiling

rm -rf node_modules && yarn

Unable to authenticate itunes

cd ~
mv .itmstransporter/ .old_itmstransporter/
"/Applications/Xcode.app/Contents/Applications/Application Loader.app/Contents/itms/bin/iTMSTransporter"

"No bundle URL present" https://stackoverflow.com/a/45121536/304894

Xcode

How to edit splash screen?

Edit LaunchScreen.xib file in xcode

Check list first time deploy to app store

  • Set devices "universial", Under Deployment Info in Targets Make sure "Requires full screen" are check for Ipad
  • Set active scheme to "Generic iOS device" to archive
  • Setup icons in Images.xcassets, every icons are required except for the smallest one. Enable ipad icons also.
  • Update Bundle identifier,version, build
  • Get iOS distribution certificate to xcode in Preferences > Account > manage certificate

Other

  • Enable In-App Purchase in Capabilities
  • In Info.plist, add "Allow Arbitrary Loads" under "App Transport Security Settings"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment