flutter_r2u 0.0.2
flutter_r2u: ^0.0.2 copied to clipboard
A new flutter plugin project.
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;
}
function | description |
---|---|
init | Instantiates the R2U module to gather needed information from our API |
isActive | Indicates the availability of a product in augmented reality |
deviceSupportsAR | Displays the compatibility of a device with the AR experience * |
openAR | Tries to display given SKU model inside the AR experience |
getLink | Returns the URL to display the 3D model inside a webview |
* List of supported devices = iOS & Android
Installation #
- Add the package
flutter_r2u
to yourpubspec.yaml
underdependencies
. - Install it with
fluter pub get
Additional steps #
iOS
- 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>
- Install the React Native pod
cd ios
pod install
Android
- 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