The Connecthings Flutter plugin allows you to access to the GDPR methods and In-App actions methods from the Dart code.

Nevertheless, the configuration of the SDK must still be done at the android and iOS app level.

A Flutter application is available on github to show you a concrete implementation.

You just have to clone the plugin repository https://github.com/Connecthings/flutter-connecthings, and open it with an android studio configured for flutter.

Initialize the SDK

Follow the iOS and Android 5-minutes quickstart to initialize the SDK at the native app level.

Android

Warning:

On Android, when you extend the default application you must use the FlutterApplication and not the default Application

public class FlutterApp extends FlutterApplication

iOS

If you meet a compilation error about the Flutter.framework duplicated, click on Runner, select Targets>Runner>Build Phases.

Next click on Embed Frameworks and remove the Flutter framework.

Add the plugin to your project

  • Open the pubspec.yaml
  • add to the dependencies section
herow:0.0.5

Being compliant with GDPR

The following methods allow your application to be compliant to GDPR.

You can find out more about this by reading our GDPR tutorial.

try {
     //To test if your application has already asked to the user the optins
     if (await Herow.optinsNeverAsked) {
       //Update the optin
       Herow.updateOptin(OPTIN_TYPE.USER_DATA, true);
       //Notify the sdk that there is no more optin to update
       Herow.allOptinsAreUpdated();
     }
     //To the the status of a given optin
     optinUserDataStatus = await Herow.isOptinAuthorized(OPTIN_TYPE.USER_DATA);
   } on PlatformException {

   }

Warning:

Untill the call to the Herow.allOptinsAreUpdated() method, the SDK won't transmit any collected data to the platform.

The In-App actions

In App Actions are events triggered when the user enter or exit from a place (a geofence zone or beacon configured on the Herow Platform)

These events allow you to realize action depending on the information associated with the place.

For example, your application UI can be updated when your user is detected inside an airport or inside in a pub.

You can find out more about this by reading our In-App actions tutorial.

Your application can be notified about In App Action events, registering to the In App Action Stream.

  Herow herow = Herow();
  herow.inAppActionEvents.listen((data) {
    //Status allow to determine if it is a "CREATION" or "REMOVE"
    print("data is data:" + data.status.toString());
    print("data is data:" + data.id);
    print("data is data:" + data.title);
    print("data is data:" + data.description);
    print("data is data:" + data.tag);
   }, onDone: () {
     print("done is done");
   }, onError: (error) {
     print("error is error");
   });