In this unit, you'll use forceios
tool and generate a template native iOS App.
In this step you'll use forceios tool to generate a sample React Native app that uses mobile SDK. In order to connect to Salesforce, we need to have a Salesforce Connected App with a new App ID and Callback URL. To simplify, forceios tool generates a template app that already uses a test app's "App ID" and "Callback URL"
forceios create
and hit enter to start generating the sample app.react_native
for Enter your application type (native, nativeswift, reactnative, hybridremote, or hybridlocal): and hit Enter. This generates a sample app for type React Native iOS.ReactNativeSample
for Enter your application name: and hit Enter.com.example.reactnativesample
for Enter the package name for your app (com.mycompany.my_app):Example Inc
for Enter your organization name (Acme, Inc.):ReactNativeSample
Note that this make take few minutes to download and install everything
In this step you'll use Cocoapods
tool to install Salesforce Mobile SDK's dependencies.
ReactNativeSample
by running: cd ReactNativeSample
pod install
ls -al
in the terminal, you should see ReactNativeSample.xcworkspace
among other files. Open the app by running: open ReactNativeSample.xcworkspace
. This opens the app in Xcode.
Note: You should open
ReactNativeSample.xcworkspace
and NOT theReactNativeSample.xcproject
because the xcworkspace will now have the pod files.