Get started

Connect to Back4App

14min

Add Back4App to your App project

Now that you have created an App at Back4App, the next step to use the backend features is to connect with Back4App servers. You will see how to install the SDK and initialize your App project using the Back4App API and your Keys.

The Open source Parse SDK is available in the main frontend technologies including JavaScript (ReactJS, React Native, AngularJS, VueJS, NodeJS), iOS (Objective-C/Swift), Android (Java/Kotlin), Flutter, PHP, .NET/Xamarin, Unity, Embedded C. You can also connect using the GraphQL or REST APIs.

In this guide, you will connect and send your first API Call to Back4App using the Parse SDK.

Goal

  • To Add Back4App to your software project using the Parse SDK.

Prerequisites

To complete this tutorial, you will need:

  • An application software project environment ready to use.
  • Find your application keys at Core Settings. go to Server Settings > Core Settings > Settings > App Id and other.

1 - Create your App at Back4App

If you still do not have an App at Back4App please take a look at our guide and see how to create your first Back4App App.

2 - Install Parse SDK

JavaScript - React Native

JavaScript - React

JavaScript - Node.js

JavaScript - Angular

JavaScript - Browser-based application

Flutter

Android

Gradle set up

Go to your Android Studio Project and find the build.gradle (Module:app) file. After that, copy and paste the code snippet right after thedependencies{} tag.

Java


It’s also necessary to look in theandroid{} tag if the compileSdkVersion of your app is 27 or higher and also if the targetSdkVersion of your app is 27 or higher. If they aren’t, you must change these versions to 27 or higher, otherwise your Parse SDK for Android may not work properly.

Install the Parse Android SDK

To install the latest Parse Android SDK in your application, continue in the build.gradle(Module:app) file and copy and paste the code snippet inside the dependencies{} tag.

Java


You can find out which is the latest version of Parse SDK for Android at the Jitpack Website.

Facing any trouble? Feel free to check the complete Install Parse SDK guide for Android projects. Also, feel free to check the official Parse Documentation regarding Parse SDK for Android.

iOS

Install CocoaPods and Import Parse

Xcode can use CocoaPods as a dependency manager for Swift and Objective-C Cocoa projects. To install CocoaPods, copy the following code snippet, paste it into your terminal, and hit return.

$ sudo gem install cocoapods

You can refer to the CocoaPods Getting Started Guide for additional details.

Connect your Parse App

Open your project’s AppDelegate file to set up the app’s credentials. Parse SDK for iOS uses these settings to connect to the Back4App servers. At the top of the file, you should see a function called didFinishLaunchingWithOptions. Paste the following code snippet inside this function, and make sure it is above the line that says return true.

iOS Swift

At the top of your AppDelegate.swift file make sure to include Parse as a module by using the following code snippet right below import UIKit.

AppDelegate.swift


iOS Objective-C

At the top of your AppDelegate.m file make sure to include Parse as a module by using the following code snippet right below #import "AppDelegate.h".

AppDelegate.m


Facing any trouble? Feel free to check the complete Install Parse SDK guide for iOS Swift and iOS ObjC projects. Also, feel free to check the official Parse Documentation regarding Parse SDK for iOS.

PHP

You can use different ways to install the Parse SDK for PHP. We will show a couple of them here. Note that the Parse PHP SDK requires PHP 5.4 or newer.

With composer

Create a composer.json file in your project's root folder, containing the following.

{ "require": { "parse/php-sdk" : "1.6.*" } }

Now, you need to run the “composer install” to download and set up the autoloader. After that, you can require it from your PHP script, using the code below.

PHP


With Git

Go to Parse SDK for the PHP page on GitHub and clone it. You can do this by using your favorite GitHub client or via a terminal, as shown below.

$ git clone https://github.com/parse-community/parse-php-sdk.git

After that, inside your PHP file, you need to include the autoload.php to automatically load the Parse SDK classes.

Facing any trouble? Feel free to check the official Parse Documentation regarding Parse SDK for PHP.

.NET

We need to add some libraries to set up Parse SDK for .NET. We will get them through Nuget Packages. To do so, go to Microsoft Visual Studio, and at the Solution Explorer, click on your app’s name and go to Manage NuGet Packages... .

Then, click on Browse to search and install the packages parsed by Parse and Xamarin.Android.Support.v7.AppCompat by Xamarin Inc.

Facing any trouble? Feel free to check the official Parse Documentation regarding Parse SDK for .NET.

Unity

Find this project page on GitHub and clone it. Then, open it on Unity3D.

Facing any trouble? Feel free to check the official Parse Documentation regarding Parse SDK for Unity.



3 - Insert your Keys and initialize Parse SDK

Please check the comments before copying and use the code below.

JS
Flutter
Android
Swift
ObjectiveC
PHP
Unity


Your keys are available at your Dashboard >App Settings>Security & Keys.

Unity

You need to add your applicationId and dotNetKeyto your project. To do so, click on Back4appDemoSence, find a GameObject that calls Back4appIntialize, and paste there your keys, as shown in the image below.

Document image


Facing any trouble? Feel free to check the official Parse Documentation regarding Parse SDK for Unity.

4 - Save and Read your first Data Object

To ensure that the connection between your project and Back4App has been established correctly, let’s make a test in which we will save and read an object in Back4App.

Use the code according to the Parse SDK you are using.

JS
Flutter
Arduino
Swift
ObjectiveC
PHP
.NET
Unity
REST API


5 - Go to Dashboard and check your Data

After running the code chosen above, you can back to your Dashboard and refresh the browser to see the changes :)

Document image


What to do Next?

After a quick start, we recommend keeping exploring the Back4App main features by checking out the guides below.

Updated 28 Mar 2024
Did this page help you?