Flutter

Getting Started

A wrapper for the MOVE SDK is available for Google's Flutter framework and published on pub.dev.

https://pub.dev/packages/movesdk

Installation

Add the Dolphin MOVE SDK package to your flutter app using:

flutter pub add movesdk

or, by adding it as a dependency to your pubspec.yaml file and run:

flutter pub get

Add the following section within the root build.gradle.

allprojects {
    repositories {
        google()
        mavenCentral()
        maven {
            url "https://dolphin.jfrog.io/artifactory/move-sdk-libs-release"
        }
    }
}

Also please check if the following values are set within the app build.gradle.

minSdkVersion 26 or higher compileSdkVersion 34 targetSdkVersion 34

android {
    compileSdkVersion 34
    // ...
    // ...
    defaultConfig {
        // ...
        // ...
        minSdkVersion 26
        targetSdkVersion 34
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        // ...
        // ...
    }
    // ...
    // ...
}

See Flutter - Using packages for further information regarding package use.

Import the package in your code:

import 'package:movesdk/movesdk.dart';

See the included example (move-sdk-flutter/example) project in the package for reference on how to get started.

iOS

Initialization

The SDK will be automatically initialized and load its persisted state in the plugin's lifecycle through theFlutterAppDelegate.

Setting up Permissions

The MOVE SDK requires several permissions to function.

Make sure required permissions are added in your iOS Runner.workspace and also the corresponding strings for requesting user permissions are set in the projects Info.plist.

If you are using the flutter-permission-handler package refer to this guide (see also here) to add the permissions in your iOS Podspec file.

Android

Initialization

The SDK needs to be initialized at the start of the app by calling MoveSdk.init. It is recommended to put this in the Application's onCreate method. This will load the persistent Move SDK state.

import io.dolphin.move.MoveSdk

class MainApplication : Application() {
    override fun onCreate() {
        super.onCreate()
        val sdk = MoveSdk.init(this)
        ...
    }
    
    ...
}

Setting up Permissions

Permission setup is inherited automatically.

Last updated