React Native (Expo) App with authentication flow using AWS Amplify + Cognito.
Custom SignIn, SignUp, ForgotPassword screens.
Homogeneous theme across screens using /styles.
(NOT tested in Android environment).
This app integrates features from various sources :
Other References
useReducer() hooks API : https://reactjs.org/docs/hooks-reference.html#usereducer
AWS authentication with Amplify : https://docs.amplify.aws/lib/auth/getting-started/q/platform/js
Tektuitive Video : Both built-in & custom RN authentication w/ AWS Amplify : https://www.youtube.com/channel/UCKBWovN9JcjEPoO5rCm9eCA/videos
Tektuitive GitHub : https://github.com/tektuitive/react-native-amplify-tutorial/tree/main/src
git clone
won’t work!There are many prerequisites to be installed before we can actually install RN.
Make sure ALL are installed.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew install node
sudo npm i -g react-native-cli
# i for install, -g for global
To build ios projects under Xcode, we need the following as well (yarn is not a must, but a good to have).
brew install cocoapods
sudo gem install cocoapods
brew install watchman
brew install yarn
To do so, first check if Git is installed by
git --version
.
If nothing shows up, you need to install Xcode, which will also install Git.
Check if Xcode is installed byxcode-select -p
If directory exists, Xcode is installed. Otherwise, install Xcode from App Store.
From your local machine, open Terminal, and go to (cd
into) a directory where you would like to copy (clone) this project.
Do NOT create project directory, since clone
will create a project directory with the name rn_ble_manager_v2
(name of this repo).
Paste following :
git clone https://github.com/onehwengineer/rn_ble_manager_v2.git
You will now notice that [your project dir]/rn_ble_manager_v2 is created.
If this repo was cloned before, and you’d like to “get” the latest updates to this repo, follow this step
cd
into project directory, /rn_ble_manager_v2git pull origin master
This will get, or “pull” all the latest changes in the remote repo to your local repo.cd
into /rn_ble_manager_v2npm install
cd
into /ios (a sub-directory of rn_ble_manager_v2), and type pod install
cd ..
to go back to project directoryFor any apps with react-native-vector-icons library, below steps must be done after cloning.
Otherwise, failed to build ios project… error code 65 will show up when react-native run-ios
is run.
[1] Unlink react-native-vector-icons library
react-native unlink react-native-vector-icons
cd ios
-> pod install
-> cd ..
[2] Install again
npm install --save react-native-vector-icons
—save is important herecd ios
-> pod install
-> cd ..
[3] Add fonts manuall for ios and android (use your text editor - I use VSCode)
<key>UIAppFonts</key>
<array>
<string>AntDesign.ttf</string>
<string>Entypo.ttf</string>
<string>EvilIcons.ttf</string>
<string>Feather.ttf</string>
<string>FontAwesome.ttf</string>
<string>FontAwesome5_Brands.ttf</string>
<string>FontAwesome5_Regular.ttf</string>
<string>FontAwesome5_Solid.ttf</string>
<string>Foundation.ttf</string>
<string>Ionicons.ttf</string>
<string>MaterialIcons.ttf</string>
<string>MaterialCommunityIcons.ttf</string>
<string>SimpleLineIcons.ttf</string>
<string>Octicons.ttf</string>
<string>Zocial.ttf</string>
</array>
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
For this step, make sure to use your PERSONAL laptop/iphone
[0] Sign up for Apple Developer account (don’t need to pay anything)
Connect your iPhone to a Mac via Lightening cable
Double click : …/rn_ble_manager_v2/ios/rn_ble_manager_v2.xcworkspace to launch RN app in Xcode
[1] Sign in to Xcode with your developer’s account
[2] Assign team
[3] Connect your iPhone to a Mac via Lightening cable
[4] Verify Developer App certificate
[5] Hit Run button in Xcode!
Author: onehwengineer
Source Code: https://github.com/onehwengineer/expo_amplify_init2
#react-native #react #mobile-apps