React Native
Parse SDK (REST)

Start your React Native Expo project using a pre-built template

9min

Introduction

In this section, you will learn how to get started with React Native using an Expo template and how to connect it to Back4App in 4 easy steps.

Prerequisites

To complete this tutorial, you will need:

1 - Get the template

To get the template project, download and unzip the source code at our GitHub repository into your machine or clone the project with the git command line.

Run the following command to download and extract the template using CURL:

curl -LOk https://github.com/templates-back4app/react-native-template/archive/master.zip && unzip master.zip

OR

Run the following command to clone the template using GIT:

git clone https://github.com/templates-back4app/react-native-template

2 - Download the app’s dependencies

  1. Make sure that you have installed npm or yarn in your system.

Look at the get npm or get yarn guides for more info.

2. On your terminal, run cd react-native-template-master and open the project's root directory.

3. Run npm install to install dependencies.

In this tutorial, we are using npm to manage dependencies but you are free to use yarn instead.

3 - Set up the app’s credentials

To allow the App to securely connect to Back4App servers, you must provide Parse JavaScript SDK with the app’s credentials.

  1. Locate your App ID and Javascript Key credentials by navigating to your app Dashboard > App Settings > Security & Keys.

On the project’s root directory, open the file at: app/(tabs)/index.tsx.

The file should look like this:

index.tsx


Copy and paste your App Id and Javascript Key on it.

4 - Test your connection

Inside the App.js of your template project, there is a function that creates a Person object and another for fetching People of your App to your Back4App Database.

index.tsx


To run and test your App connection:

  1. Open your project’s terminal.
  2. Runnpm run android or npm run ios or npm run start to open the application on your target platform



Document image


It’s done!

At this point, you have learned how to get up and run a React Native application connected to Back4app.

Updated 31 Oct 2024
Did this page help you?