1. Setup Developer Environment

In this unit, you set up a developer environment to build React Native app using Salesforce Mobile SDK. You'll install quiet a lot of tools but the good news is that it's just one time setup. And after that, you'll be able to build complex Native apps using mainly React and JavaScript knowledge.

Step 1: Install Xcode

  1. Go to Apple's developer site and Download Xcode
  2. Click on "View in the Map App Store" - This opens "App store" app on your mac.
  3. Install it and then click open to open Xcode.

Note: Latest Xcode version is: 7.2

Step 2: Install Node.js

Salesforce Mobile SDK's forceios tool, React and React Native all need node.js. Install Node.js if you don't have it yet.

  1. Go to nodejs.org and install Node.js
  2. Open Terminal, and type: node -v, you should see current Node version.
  3. Now, type npm -v, you should see npm's(Node Package Manager) current version.

    npm is a command line tool that is installed as part of Node.js installation and is used to install various node.js libraries.

Step 3: Install Homebrew

Homebrew is a popular repository for 1000s of OS X applications like Node.js, MongoDB, etc. React Native recommends installing several tools like Watchman and Flow.

  1. Open Homebrew website.
  2. Follow instructions on the site to install it.

    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    

Step 4: Install CocoaPods

CocoaPods is a dependency manager for Objective-C and Swift projects. It's similar to 'npm' in the Node.js World. Salesforce Mobile SDK uses CocoaPods to install several iOS libraries.

  1. Open Terminal
  2. Run: sudo gem install cocoapods

Step 5: Install Other CLI Tools

  1. Open Terminal
  2. Install Watchman by running: brew install watchman
  3. Install React Native CLI by running: sudo npm install react-native-cli -g
  4. Install forceios tool by running: sudo install forceios -g

    Watchman file watching is used to by React Native to monitor development changes and instantly convert them to a Native app.

Additional Resources

index
  1. Setting Up Developer Environment
  2. Creating forceios App
  3. Running forceios App
  4. Adding Connected App
  5. Updating JavaScript
  6. Adding New React Native Component
  7. Workflow Summary
  8. Next Steps
comments powered by Disqus