reactnativesdktest
As validated on macOS Sierra 10.12.5
Setup development environment
-
Install Xcode from the Mac App Store
-
Install brew:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
-
Install dependencies:
brew install node brew install watchman brew install wget npm install -g react-native-cli sudo gem install cocoapods
-
Set Git preferences:
git config --global user.email "your_email@example.com" git config --global user.name "Your Name"
-
Clone repository:
cd ~ git clone https://github.com/agolden/reactnativesdktest.git
Run app
-
Install dependencies:
cd ~/reactnativesdktest npm install cd ~/reactnativesdktest/mobile_sdk wget https://github.com/forcedotcom/SalesforceMobileSDK-iOS/archive/master.zip unzip master.zip mv SalesforceMobileSDK-iOS-master/* salesforcemobilesdk-ios/ cd ~/reactnativesdktest/ios pod install
-
Run react native server:
cd ~/reactnativesdktest npm start
-
Open workspace in Xcode (using separate terminal window):
cd ~/reactnativesdktest/ios open sdktest.xcworkspace
-
Run application from Xcode (Suggest viewing on iPhone 7)
View React Native Logs
- From the iOS simulator, hit command+D
- Select 'Debug Remote JS' (should open new tab/window in Chrome)
- Open Developer Tools (command+option+J)
- Select 'Console' tab; react native logging now appears in console below.
Reproduce Issue
- Launch application (login screen appears)
- Click 'Login' button (then wait a couple seconds for the Salesforce login screen to appear)
- Select 'Use Custom Domain'
- Enter totally fake custom domain, e.g., 'ABCDEFG' (error message appears: "SERVER ERROR'; "Can't connect to the server....")
- Select 'Dismiss' (user is now stranded on a blue screen with no way to get back; no error messages appear in react native logs)
Expected Behavior
- Launch application (login screen appears)
- Click 'Login' button (then wait a couple seconds for the Salesforce login screen to appear)
- Select 'Use Custom Domain'
- Enter totally fake custom domain, e.g., 'ABCDEFG' (error message appears: "SERVER ERROR'; "Can't connect to the server....")
- Select 'Dismiss'; As shown in 'app.js' on line 65, the failure callback is invoked and 'Failed to authenticate' is written to the react native logs; User returned to the react-native app, which now displays the error message "You were unable to log in!" below the login button.