Augment Mobile SDK - React-native

Getting Started

This is the official Augment plugin for react-native, it will allow you to use Augment Mobile SDK on iOS and Android within a react-native App.

Install the plugin

npm install react-native-augment --save
react-native link react-native-augment

Android specifics

(AugmentAndroidSDK: 3.0.0-beta.x)

To enable Augmented reality feature you have to add the following code to the Android Manifest at android/app/src/main/AndroidManifest.xml:

    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.CAMERA"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Also, because of the automatic initialization of the SDK, the credentials must be put in the android/app/src/main/AndroidManifest.xml too:

       android:value="357fee36746668573ceb2f5957c4869ee1a62a112639bac9b0fae43c7c431692" />
       android:value="80ae1420e164e0440d5329067bcdd953e9fa6c63b75c001c06d169a4f11268c5" />

and then edit your Project gradle at android/build.gradle to add:

allprojects {
    repositories {
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        // Add these line
        maven { url  "" }
        maven { url '' }

Remember that the mobile AugmentSDK will work only on real devices, be sure to have a real device connected when starting the app with react-native run-android

iOS specifics

With iOS 10 and higher you need to add the “Privacy - Camera Usage Description” key to the Info.plist file of your project.

Add the following code:

<string>We need to access your Camera to show you Augmented reality</string>

Then you should import the AugmentSDK into your project using CocoaPods by adding to your Podfile:

# omit this line if you already use it

pod 'AugmentPlayerSDK', '4.0.17'

Note: Remember that the mobile AugmentSDK will work only on real devices, so you may need to start the project with XCode instead of react-native run-ios so you can choose the device.


Thanks to the Augment react-native plugin you will now have access to the AugmentPlayerSDK class in your javascript and AugmentPlayer component. With this plugin you can query if a product is available and then display it on an Augmented reality view.

A working example

This example covers how to implement a full Augmented reality session that uses Augment React-native Plugin


You need to import the component and init your instance.

import { AugmentPlayerSDK, AugmentPlayer } from 'react-native-augment';

// These are demo credentials linked to the demo catalog below
    id:  "357fee36746668573ceb2f5957c4869ee1a62a112639bac9b0fae43c7c431692",
    key: "80ae1420e164e0440d5329067bcdd953e9fa6c63b75c001c06d169a4f11268c5"  

Products and catalog

Your first catalog

Augment SDK work with catalogs, when you ask for an API KEY we create a catalog on our server that will link between your references and our models.

To help you test our SDK we provide a demo catalog containing some demo references, here are the data

82LenovoYoga 900
89Restoration HardwareChair
90Restoration HardwareTable
92TargetOutdoor Chair
93Bed BathTable
94Bed BathCurtains
95Sun LoungerFrontgate

EAN are optional, pass an empty string for the demo

Query and load products

At any time after the AugmentPlayerSDK.init you can query Augment for a product.

In order to query a product: create a new product JSON object with an identifier, name, brand and optional ean and pass it to the AugmentPlayerSDK.checkIfModelDoesExistForUserProduct method.

If the product exists in Augment database, checkIfModelDoesExistForUserProduct will return an AugmentProduct instance within its success callback or null if this product does not exist. The error callback will be called only if there is an error.

// Product JSON object
var productToSearch = {
    identifier: "84",
    brand: "Whirlpool",
    name: "Fridge",
    ean: ""

.then(function (augmentProduct) {
    // Check if the Augment API found a corresponding Product
    if (!augmentProduct) {
        alert('Product not found');

    // We have the augmentProduct here :)

.catch(function (error) {
    // Error is a JSON object {error: string}

An AugmentProduct is a JSON object:

type AugmentProduct = {
    identifier: string,
    brand: string,
    name: string,
    ean?: string


To start the Augment View use the view component <AugmentPlayer onPlayerReady={} loaderCallback={} />

The onPlayerReady props will give you the AugmentPlayer instance, on this object you have access to the player’s methods like .recenterProducts, .addProduct
and with the loaderCallback props you can handle the loading progress of the 3D model

class Example extends Component {

    loader(loaderStatus) {
        // Product and AR general loading
        // This is here to allow you to give feedback to your user
        // {progress: int, show: bool}
            loaderText: "Loading " + loaderStatus.progress + "%"

    business(player, error) {
        if (error) {

        this.playerInstance = player;
        .then(() => {
            console.log("The product has been added to the ARView");
        .catch((error) => {

    render() {
        return (
            <AugmentPlayer style={styles.augmentPlayer}

After this step, you should be seeing the model on your screen.

Full API

Prepare Session

AugmentPlayerSDK.init: (credentials: AugmentPlayerSDKInit) => void;

Init the Augment Plugin, it needs to be called before anything else.

AugmentPlayerSDK.checkIfModelDoesExistForUserProduct: (product: AugmentProduct) => Promise <Error, ?AugmentProduct>;

Query Augment servers to check if a given product exists, returns the product (or null if not found) in the promise.

<AugmentPlayer ... />

Start the Augmented View and create the Augment Player

AugmentPlayer tracking status

When AR is available, the AugmentPlayer will notify a tracking status to let you know what’s happening internally. Here are the all the possible AugmentPlayer.Constants.TrackingStatus values:

initializing, //The underlying AR system is getting set-up.
normal, //The AR tracking is working properly and the discovery mode is active.
notAvailable, //The AR tracking is not available; try reseting the player.
limitedExcessiveMotion, //Tracking is limited due to a excessive motion of the camera.
limitedInsufficientFeatures, //Tracking is limited due to a lack of features (illumination or details) visible to the camera.
featuresDetected*, //Some features has been detected. Invite the user to explorer a little more to detected a plane to place the product.
planeDetected*, //Your camera is pointing right over a surface. Invite the user to tap to place the product on the plane.
error, //Something went wrong with the player, this message will tell you what.

* = only on iOS

You can track these by passing onTrackingStatusChanged:

    render() {
        return <AugmentPlayer onTrackingStatusChanged={this.onTrackingStatusChanged.bind(this)} ... />

    onTrackingStatusChanged = ({ status, message }) => {
        switch (status) {
          case AugmentPlayer.Constants.TrackingStatus.error:
            console.log('An error occurred during tracking: ' + message);
          // ...
            console.error('Unrecognized status ' + status);
type TrackingStatusChangedEvent = {
    status: integer,
    message?: string

AugmentPlayer model’s gestures

The AugmentPlayer will also notify the model’s gestures:


You just have to use pass onModelGesture with props:

    render() {
        return <AugmentPlayer onModelGesture={this.onModelGesture.bind(this)} ... />

    onModelGesture = (event) => {
        switch (event.gesture) {
        case AugmentPlayer.Constants.ModelGesture.added:
            console.log('Model with uuid ' + event.model_uuid + " has been placed");

The received event contains both a gesture and the corresponding model3D’s UUID.

type ModelGestureEvent = {
    gesture: integer,
    model_uuid: string

Augment Player’s methods

The AugmentPlayer component expose a few methods to interact with Augmented Reality. You can save a reference to the current player component this way:

<AugmentPlayer ref={ref => { this.augmentPlayer = ref; }} ... />
this.augmentPlayer.addProduct: (product: AugmentProduct) => Promise<Error, Void>;

Add a product to the Augmented View (player), it could be a product you got back from the API, or it could be a product you want to search for (in that case the error management will be handled by the Augmented View).

this.augmentPlayer.recenterProducts: () => void;

Allows the user to recenter products in the Augmented View (player).

this.augmentPlayer.takeScreenshot: () => Promise<Error, String>;

Allows the user to save a screenshot; it returns the absolute path of the saved image.


Due to some dependency constraints, Augment Plugin will only works on real devices

Feedback and Contact

We are always interested in your feedback and suggestions for how we can improve this documentation. Please email us at

layout: page title: Augment Mobile SDK - Android FAQ permalink: /android-sdk-faq platform: Android —

Android FAQ

What if the minSdkVersion of my app is lower than the required by the SDK?

The android framework let you force the use of a library with a higher minSDK by adding this to the Manifest:

  <uses-sdk tools:overrideLibrary="" />
  <!-- if you're using RN bridge, use: -->
  <!-- <uses-sdk tools:overrideLibrary=", com.augment.reactplugin" /> -->

Then, you must do a manual validation before launching the AR to avoid Runtime Errors:

  // you may open the AR