Quickstart
Back4App is an open source (based on Parse Platform), low code platform that helps you to develop modern apps. On Back4App, you will find the following features:
- Data Storage (Relational)
- Cloud Code Functions
- APIs (GraphQL and REST)
- File Storage
- Authentication
- Push Notifications
5-minute quick start
After creating your Back4App account and your first App, go to your App Dashboard and get your App Keys under App Settings-> Security & Keys(check the image below). Note that you will always need two keys to connect with Back4App, the Application ID, and another key according to the SDK you will use.
On your React Native project you will use the Parse Javascript SDK to connect with Back4App (Javascript SDK can be used with in Javacript-based project).
1. Install Parse SDK
Install the Parse NPM module and the AsyncStorage. To do so, run the following command.
$ npm install parse @react-native-async-storage/async-storage --save
Use CocoaPods to add the native RNAsyncStorage to your project:
cd ios & pod-install
2. Initialize the SDK using your Application ID and JavaScript Key
App.js
1
2
3
4
5
6
7
8
9
10
//On your App.js file
import AsyncStorage from '@react-native-async-storage/async-storage';
import Parse from 'parse/react-native';
//Before using the SDK...
Parse.setAsyncStorage(AsyncStorage);
//Paste below the Back4App Application ID AND the JavaScript KEY
Parse.initialize('YOUR_APPLICATION_ID_HERE', 'YOUR_JAVASCRIPT_KEY_HERE');
//Point to Back4App Parse API address
Parse.serverURL = 'https://parseapi.back4app.com/'
3. Save your first data on Back4App
Call the function saveNewPlayer to save your first data on Back4App. After calling the function go to your App Dashboard and check the data you’ve just saved.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
async function saveNewPlayer() {
//Create your Parse Object
const soccerPlayer = new Parse.Object('SoccerPlayer');
//Define its attributes
soccerPlayer.set('playerName', 'A. Wed');
soccerPlayer.set('yearOfBirth', 1997);
soccerPlayer.set('emailContact', '[email protected]');
soccerPlayer.set('attributes', ['fast', 'good conditioning']);
try {
//Save the Object
const result = await soccerPlayer.save();
alert('New object created with objectId: ' + result.id);
} catch (error) {
alert('Failed to create new object: ' + error.message);
}
}
Install the Parse Flutter SDK
Install the latest Parse Flutter SDK in your application. First of all, create a Flutter Project using the following commands:
Create a Flutter Project
flutter create flutter_parse
Check if everything is OK running the application:
cd flutter_parse
flutter run
Installing Flutter plugin for Parse Server
You will add Parse to the project dependencies. Go to pubspec.yaml and add the following:
dependencies:
parse_server_sdk_flutter: ^latest_version
1. Setting up Parse SDK
In your Dart Code, clean all main.dart code and start a new one importing the Parse SDK.
main.dart
1
2
import 'package:flutter/material.dart';
import 'package:parse_server_sdk_flutter/parse_server_sdk.dart';
2. Initialize the SDK using your Application ID and Client Key
main.dart
1
2
3
4
5
6
7
8
void main() async {
final keyApplicationId = 'YOUR_APPLICATION_ID_HERE';
final keyClientKey = 'YOUR_CLIENT_KEY_HERE';
final keyParseServerUrl = 'https://parseapi.back4app.com';
await Parse().initialize(keyApplicationId, keyParseServerUrl,
clientKey: keyClientKey, debug: true);
}
3. Save your first data on Back4App
1
2
3
4
5
6
7
8
9
10
11
//Saving your First data object on Back4App
void main() async {
Future<String> saveNewPlayer() async {
final soccerPlayer = ParseObject('SoccerPlayer')
..set('playerName', 'A. Wed')
..set('yearOfBirth', 1997)
..set('emailContact', '[email protected]')
..set('attributes', ['fast', 'good conditioning'])
await soccerPlayer.save();
return soccerPlayer.objectId;
}
Facing any trouble? Feel free to check the complete Install Parse SDK guide to Flutter projects. Also, feel free to check the official Parse Documentation regarding Parse SDK for Flutter.
1. Parse Android SDK Installation
Go to your Android Studio Project and find the build.gradle (Module:app) file. After that, copy and paste the code snippet right after the dependencies{} tag.
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.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// ... code
android {...}
dependencies {
// code...
// Don't forget to change the line below with the latest version of Parse SDK for Android
implementation "com.github.parse-community.Parse-SDK-Android:parse:latest.version.here"
}
repositories {
mavenCentral()
jcenter()
maven { url 'https://jitpack.io' }
}
You can find out which is the latest version of Parse SDK for Android at Jitpack Website.
Facing any trouble? Feel free to check the complete Install Parse SDK guide to Android projects. Also, feel free to check the official Parse Documentation regarding Parse SDK for Android.
2. Initialize the SDK using your Application ID and Client Key
Inside the strings.xml file, insert the following lines, with your application keys, in order to connect your project to Back4App Database.
./app/src/main/res/values/strings.xml
1
2
3
4
5
6
<resources>
<string name="back4app_server_url">https://parseapi.back4app.com/</string>
<!-- Change the following strings as required -->
<string name="back4app_app_id">APP_ID</string>
<string name="back4app_client_key">CLIENT_KEY</string>
</resources>
3. Give Permissions and set up your App
You need to grant permission for your Android app to access the internet network. To do this, add the following code snippet to your AndroidManifest.xml file right after the application tag.
./app/src/main/AndroidManifest.xml
1
2
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
Also, inside the application tag, add the following:
./app/src/main/AndroidManifest.xml
1
2
3
4
5
6
7
8
9
<meta-data
android:name="com.parse.SERVER_URL"
android:value="@string/back4app_server_url" />
<meta-data
android:name="com.parse.APPLICATION_ID"
android:value="@string/back4app_app_id" />
<meta-data
android:name="com.parse.CLIENT_KEY"
android:value="@string/back4app_client_key" />
4. Initialize Parse SDK
Create a Java file called App that extends Application. Inside App.java onCreate method, right after super.onCreate() call the following code:
1
2
3
4
5
6
7
8
9
import com.parse.Parse;
Parse.initialize(new Parse.Configuration.Builder(this)
.applicationId(getString(R.string.back4app_app_id))
// if defined
.clientKey(getString(R.string.back4app_client_key))
.server(getString(R.string.back4app_server_url))
.build()
);
Don’t forget to define this file in the
AndroidManifest.xml. To do so, go to theAndroidManifest.xmlfile and add the following line of code inside theapplicationtag:
1 android:name=".App"If the name of the java file that extends Application that you created on the previous step isn’t “App”, don’t forget that the code above should have the correct name of the file (
android:name=".name_of_the_file").
Facing any trouble? Feel free to check the complete Install Parse SDK guide to Android projects. Also, feel free to check the official Parse Documentation regarding Parse SDK for Android.
5. Save your first data on Back4App
Call the function saveNewPlayer to save your first data on Back4App. After calling the function go to your App Dashboard and check the data you’ve just saved.
1
2
3
4
5
6
7
8
private void saveNewPlayer() {
ParseObject soccerPlayer = new ParseObject("SoccerPlayer");
soccerPlayer.put("playerName", "A. Wed");
soccerPlayer.put("yearOfBirth", 1997);
soccerPlayer.put("emailContact", "[email protected]");
soccerPlayer.put("attributes", ["fast", "good conditioning"]);
soccerPlayer.saveInBackground();
}
Install CocoaPods and Import Parse
Xcode can use CocoaPods as dependency manager for Swift Cocoa projects. To install CocoaPods, copy the following code snippet and paste it into your terminal and hit return.
$ sudo gem install cocoapods
You can refer to CocoaPods Getting Started Guide for additional details.
Connect your Parse App
Open your project’s AppDelegate file to set up 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.
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
1
import Parse
Facing any trouble? Feel free to check the complete Install Parse SDK guide to iOS Swift projects. Also, feel free to check the official Parse Documentation regarding Parse SDK for iOS.
2. Initialize the SDK using your Application ID and Client Key
AppDelegate.swift
1
2
3
4
5
6
let configuration = ParseClientConfiguration {
$0.applicationId = "PASTE_YOUR_APPLICATION_ID_HERE"
$0.clientKey = "PASTE_YOUR_CLIENT_ID_HERE"
$0.server = "https://parseapi.back4app.com"
}
Parse.initialize(with: configuration)
3. Save your first data on Back4App
1
2
3
4
5
6
7
8
9
10
11
12
13
var soccerPlayer = PFObject(className:"SoccerPlayer")
person["playerName"] = "A. Wed"
person["yearOfBirth"] = 1997
person["emailContact"] = "[email protected]"
person["attributes"] = ["fast", "good conditioning"]
person.saveInBackground {
(success: Bool, error: Error?) in
if (success) {
// The object has been saved.
} else {
// There was a problem, check error.description
}
}
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 projects 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.
1
require 'vendor/autoload.php';
With Git
Go to Parse SDK for PHP page on GitHub and clone it. You can do this by using your favorite GitHub client or via 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.
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 parse 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.
Find this project page at 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.
What to do Next?
After a quick start, we recommend keeping exploring the Back4App main features by checking out the guides below. You will find how to store and query relational data, use cloud functions to add business logic to your backend, use real-time subscriptions to keep your users up-to-date, store files, send push notifications, use the authentication mechanisms available on Back4App, and more. Choose the technology that suits you and enjoy the journey.