dimx_flutter_sdk 0.1.2-rc8 copy "dimx_flutter_sdk: ^0.1.2-rc8" to clipboard
dimx_flutter_sdk: ^0.1.2-rc8 copied to clipboard

Flutter plugin for the DimensionX mobile SDK: opens DimensionX AR experiences and their web pages from a Flutter app on Android and iOS.

dimx_flutter_sdk #

Flutter plugin for the DimensionX mobile SDK on Android and iOS: open a DimensionX AR experience, or its web page, from a Flutter app.

import 'package:dimx_flutter_sdk/dimx_flutter_sdk.dart';

final dimx = DimxPlugin();

await dimx.initializeDimxSdk({
  'qrCodeEnabled': true,
  'sharePhotoEnabled': true,
  'shareVideoEnabled': false,
  'webVersionUrl': 'https://app.dimx.world/version',
  'defaultAppUrl': 'https://go.dimx.world',
  'appScreenActivity': 'com.example.my_app.MainActivity', // Android
});

await dimx.showARScreen('https://go.dimx.world/?dim=3358080808&loc=2134961551&live=1&place=1');
await dimx.showWebScreen('https://go.dimx.world/?dim=3358080808');

The plugin wraps the two native SDKs at one version - dimx-android-sdk from the maven repository on dl.dimx.world and dimx-ios-sdk as a Swift package - and the plugin's version is the SDK release it is built against. The full documentation is at https://docs.dimx.world.

Installation #

flutter pub add dimx_flutter_sdk

Android #

  1. Add the maven repository the native SDK is served from to the app's repositories (android/build.gradle.kts, under allprojects):

    allprojects {
        repositories {
            google()
            mavenCentral()
            maven { url = uri("https://dl.dimx.world/sdk/android") }
        }
    }
    

    Declaring it only in the plugin is not enough: Gradle resolves a plugin's dependencies with the consuming app's repositories, and without it the build fails with Could not find world.dimx:dimx-android-sdk.

  2. minSdk 28 in android/app/build.gradle.kts: the SDK needs ARCore, which needs Android 9. The SDK's dependencies need Android Gradle plugin 8.9.1 or newer and compileSdk 36, which current Flutter templates satisfy.

  3. Pass your MainActivity, fully qualified, as appScreenActivity: it is where the SDK returns when its own screens close.

The camera and location permissions the AR screen needs come from the SDK's manifest and are requested by initializeDimxSdk; a refusal fails it with PERMISSION_DENIED.

iOS #

The plugin is a Swift package, because the native SDK is one: its engine ships as binary targets a Swift package resolves, which CocoaPods cannot do. So the app has to build its plugins through Swift Package Manager - the default since Flutter 3.44; on Flutter 3.24 to 3.43 turn it on once:

flutter config --enable-swift-package-manager

Then:

  1. iOS 16.4 or newer: the deployment target in Xcode (and platform :ios, '16.4' in the Podfile, if your app still has one - this plugin needs none).
  2. Usage descriptions in Info.plist for the camera (NSCameraUsageDescription), location when in use (NSLocationWhenInUseUsageDescription), the photo library (NSPhotoLibraryUsageDescription) and Bluetooth (NSBluetoothAlwaysUsageDescription, for beacon ranging).
  3. -ObjC in the Runner target's Other Linker Flags (Xcode: Runner target, Build Settings, Other Linker Flags, add -ObjC). The Flutter template does not set it; ARCore, inside the SDK, ships as static libraries whose Objective-C categories the linker drops without it, and the app then compiles fine and dies at launch with an unrecognized selector.
  4. A real device: the SDK ships device-only binaries, so the simulator is not a destination.

On iOS the SDK asks for the permissions itself when the AR screen opens; a refused camera shows the SDK's alert with a way to Settings and returns to the app.

Example #

example/ is the plugin's own development app, depending on the plugin by path. A sample app that consumes the published plugin the way your app would is in dimx-sdk-samples under flutter/.

flutter pub get
cd example
flutter pub get
flutter run
0
likes
0
points
436
downloads

Publisher

verified publisherdimx.world

Weekly Downloads

Flutter plugin for the DimensionX mobile SDK: opens DimensionX AR experiences and their web pages from a Flutter app on Android and iOS.

Homepage
Repository (GitLab)
View/report issues

License

unknown (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on dimx_flutter_sdk

Packages that implement dimx_flutter_sdk