appbooster_sdk_flutter 1.0.2
appbooster_sdk_flutter: ^1.0.2 copied to clipboard

Mobile framework for Appbooster platform.

appbooster_sdk_flutter #

Mobile framework for Appbooster platform.

Installation #

  1. Add this to your package's pubspec.yaml file:
    dependencies:
      appbooster_sdk_flutter:
  1. Now in your Dart code, you can use:
    import 'package:appbooster_sdk_flutter/appbooster_sdk_flutter.dart';

Usage #

Initialization: #

    await Appbooster.initialize(
      appId: "${YOUR_APP_ID}",
      sdkToken: "${YOUR_SDK_TOKEN}",
      deviceId: "${YOUR_DEVICE_ID}" // optional, UUID generated by default
      appsFlyerId: "${YOUR_APPS_FLYER_UID}" // optional
      amplitudeUserId: "${YOUR_AMPLITUDE_USER_ID}" // optional, if Amplitude integration is needed
      defaults: {"${TEST_1_KEY}": "${TEST_1_DEFAULT_VALUE}", "${TEST_2_KEY}": "${TEST_2_DEFAULT_VALUE}"},
      deviceProperties: {"installedAt": "2021-05-20T09:55:05.000+03:00"}, // optional, additional information about device
    );

After initialization all functionality will be available via singleton:

    Appbooster.instance()

How to fetch known test values that associated with your device? #

    Appbooster.instance().loadExperiments((List<String> experimentsKeys) {
        // Handle loaded experiments
    });

How to get the value for a specific test? #

    final value = Appbooster.instance().experiment("${TEST_KEY}");

In case of problems with no internet connection or another, the values obtained in the previous session will be used, or if they are missing, the default values specified during initialization will be used.

How to get user tests for analytics? #

    final value = Appbooster.instance().experiments;
    
    // or if you need additional details for experiments
    final value = Appbooster.instance().experimentsWithDetails;

How to debug? #

Before debug make sure that debug-mode for your App is turned-on on settings page

In debug mode you can see all actual tests and check how the user will see each option of the test. To show the debug bottom sheet you just need to turn it on in your personal cabinet and call

    Appbooster.instance().showDebugLayer(
      context: context,
      valuesChangedCallback: (List<String> changedExperimentsKeys) {
        // Handle changed experiments
      },
    );

You can enable showing debug bottom sheet by performing shake motion on your device:

    Appbooster.instance().enableDebugOnShake(
      context: context,
      valuesChangedCallback: (List<String> changedExperimentsKeys) {
        // Handle changed experiments
      },
    );

or disable this behavior:

    Appbooster.instance().disableDebugOnShake();
0
likes
60
pub points
0%
popularity

Publisher

appbooster.com

Mobile framework for Appbooster platform.

Homepage

Documentation

API reference

License

MIT (LICENSE)

Dependencies

dart_jsonwebtoken, flutter, http, meta, shake, shared_preferences, uuid

More

Packages that depend on appbooster_sdk_flutter