flutter_r2u

R2U Augmented Reality SDK for Flutter, currently in beta.

Methods

class R2U {
  static Future<void> init({customerId: String}) async;
  static Future<bool> deviceSupportsAR() async;
  static Future<bool> isActive(String sku) async;
  static Future<void> openAR({sku: String, resize = false}) async;
  static Future<String> getLink(String sku) async;
}
functiondescription
initInstantiates the R2U module to gather needed information from our API
isActiveIndicates the availability of a product in augmented reality
deviceSupportsARDisplays the compatibility of a device with the AR experience *
openARTries to display given SKU model inside the AR experience
getLinkReturns the URL to display the 3D model inside a webview

* List of supported devices = iOS & Android

Installation

  1. Add the package flutter_r2u to your pubspec.yaml under dependencies.
  2. Install it with fluter pub get

Additional steps

iOS

  1. Add camera access permission request on your Info.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "___">
<plist version="1.0">
<dict>
  <key>NSCameraUsageDescription</key>
  <string>Camera used to display product in Augmented Reality</string>
  ...
</dict>
</plist>
  1. Install the React Native pod
cd ios
pod install

Android

  1. Add camera access permission request on your AndroidManifest.xml
<uses-permission android:name="android.permission.CAMERA" />

<application …>
    ...
    <!-- "AR Optional" app, contains non-AR features that can be used when
         "Google Play Services for AR" (ARCore) is not available. -->
    <meta-data android:name="com.google.ar.core" android:value="optional" />
</application>

Code example

Check out the examples folder of this repository

Libraries

flutter_r2u
product
state