AppboxoSDK for Flutter

A Flutter plugin to integrate the Appboxo for iOS and Android.

Usage

import 'package:appboxo_sdk/appboxo_sdk.dart';

Appboxo.setConfig("[client_id]"); //set your Appboxo client_id

Appboxo.setConfig("[client_id]", sandboxMode:false, multitaskMode: false);
//'multitaskMode' works only on Android. By default 'true', each miniapp appears as a task in the Recents screen.

Appboxo.openMiniapp("[miniapp_id]", data, theme); 
//launch miniapp by id. [data] is map, theme = "light"|"dark"|"system"

Appboxo.hideAllMiniapps(); //use it to closing all miniapp screens

Appboxo.logout(); //On logout from your app, call it to clear all miniapps data.
Appboxo.openMiniapp("[miniapp_id]", "[data]");

Use it when you need to pass data to miniapp.

Custom events

Handle events from miniapp and send to miniapp.

Appboxo.customEvents().listen((CustomEvent event) {
      if (event.appId == 'app12345') {
        event.payload = {"foo": "bar"};
        Appboxo.sendEvent(event);
      }
    });

Payment events

Handle payment events from miniapp and send to miniapp.

Appboxo.paymentEvents().listen((PaymentEvent event) {
      if (event.appId == 'app12345') {
        event.status = "success";
        Appboxo.sendPaymentEvent(event);
      }
    });

Android

Requires AndroidX Include support in android/gradle.properties

android.useAndroidX=true
android.enableJetifier=true

Libraries

appboxo_sdk