We need our endpoint’s root certificate to establish communication with HTTPS pages. ‘root_ca’ variable is holding our endpoint’s root certificate. We need to know which certificate our endpoint is using. So we can gather it with different ways. Here…
You can find root certificate from your SSL providers website or just visiting the address.
In React-Native, debugging is relatively easy but preparing an app for Google Play Store or apk for your phone needs a key to sign your app.
Get in CMD as administrator. Go to the JDK directory. cd C:\Program Files\Java\jdk*****\bin Type the following to create a file called my-upload-key.keystore in that folder. You can change the keystore name or alias. It will ask for password, i recommend you to type a strong one.
Before creating a React Native Application in Windows, i recommend to use Chocolatey. It’s a package manager application, just like yum, apt, dnf, portsnap in Linux and BSD. Install chocolatey as administrator with following CMD command.
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
I recommend to install NodeJS (especially LTS), JDK and Python in case
if we need to follow react-native command instead of Expo CLI.
choco install -y nodejs-lts python2 jdk8
Now we are ready to install react-native cli to create our sample project.
We need to set two environment variable. Go in to Control Panel. Choose System and Security -> Change Settings -> Advanced Tab -> Environment Variables and click New. Set a ANDROID_HOME variable with location C:\Users\<em>YOUR_USERNAME</em>\AppData\Local\Android\Sdk , secondly set a platform-tools variable with path C:\Users\<em>YOUR_USERNAME</em>\AppData\Local\Android\Sdk\platform-tools . Change YOUR_USERNAME with your Windows username.
Now it’s Android Studio part. We need to download couple things and create an emulator device. Open it., yes. Click Configure -> SDK Manager. Check Android 9.0 (Pie), then check Show Package Details and check Google APIs Intel x86 Atom System Image and Android SDK Platform 28 etc.
Now come to the SDK Tools path and download Android SDK Build Tools, version 28.0.3.
Turn back to Android Studio intro menu.
Click Configure -> AVD Manager -> Create Virtual Device -> ? A device choice of yours i choose Pixel 2 -> Choose Pie as System Image.
If you did all of these things, let’s create our sample project.
react-native init MySampleProject
Come in with cd MySampleProject. Run it in debug mode.
Probably you get an error while building… Finally, there is a tweak that you need to do in your created MySampleProject folder. Go in to android folder, edit build.gradle file then change to minSdkVersion = 28