zisky 2.0.1 copy "zisky: ^2.0.1" to clipboard
zisky: ^2.0.1 copied to clipboard

PlatformAndroid

ussd automation

Zisky #

Zisky is a flutter plugin that automates android ussd sessions.

import #

import 'package:zisky/zisky.dart';
import 'package:zisky/action_response.dart';

Usage #

Initialize Zisky sdk in main method #

void main() {
  runApp(MyApp());
  Zisky.init();
}
  void callBalanceEnquiry() async {

    try {

      await Zisky.startAction("action_id", getResponse);
    } on PlatformException catch (e) {
      print(e);
    }
  }

  String getResponse(response) {
    print("RESULT FINAL= $response");
    if (response != null) {
      ActionResponse responseObj =
          ActionResponse.fromJson(jsonDecode(response));

      if (responseObj.parsed_variables.containsKey("balance")) {
        setState(() {
          result = "\$" + responseObj.parsed_variables["balance"];
        });
      }
    }

    return response;
  }

  void sendMoney() async {

    try {
      Map<String, String> map = Map();
      map["amount"] = "1";
      map["destination"] = "263774......";
      await Zisky.startAction("action_id", getResponse, extras: map);
    } on PlatformException catch (e) {
      print(e);
    }
  }

Update Manifest #

<meta-data android:name="co.zisky.ApiKey"
           android:value="your_api_key"/>

Visit zisky console to get started

Github Example #

zisky-flutter-ussd-automation

4
likes
120
points
16
downloads

Publisher

unverified uploader

Weekly Downloads

ussd automation

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on zisky

Packages that implement zisky