Flutter integration
Adding Saakuru Mobile Wallet SDK to your Flutter project
Step 1: Adding Saakuru Mobile Wallet SDK to your Flutter project
Android
To begin integrating the Saakuru Mobile SDK into your Flutter Android application, you need to add the SDK package as a dependency in your project. The SDK package is hosted on Pub, making it easy to include in your app using Gradle and pubspec dependencies:
Add the following config to your "local.properties" file inside the Android directory:
iOS
To begin integrating the Saakuru Mobile SDK into your Flutter iOS application, you need to add the SDK dependencies to your project. The SDK package is hosted on Cocoapods, making it easy to include in your app using your project’s podfile:
Add the following code to your pubspec.yaml
dependencies:
metaone_wallet_sdk: ^{version} (latest ver. 1.8.8)
Step 2: Initializing SDK
Import metaone_wallet_sdk to your dart file:
import 'package:metaone_wallet_sdk/metaone_wallet_sdk.dart';
Map SDK config values:
Initialize MetaOne SDK:
await initialize(sdkConfig);
Step 3: Creating a User Session
To successfully initialize a user session, your back-end integration has to be ready first. Your backend should receive an Authorization token during the initialization request.
Initialize the session by calling: logInWithSSO(token);
Your session is initialized. You can now use all other functions that require Authorization
Call setupUserData();
to initialize user profile data
Demo app project https://github.com/AAG-Ventures/flutter-sdk-demo
Important:
To ensure a good user experience, we recommend you implement:
Initialize user session during initial auth
Refresh the user session when the session expires.
Last updated