everlink_sdk 0.1.0-beta copy "everlink_sdk: ^0.1.0-beta" to clipboard
everlink_sdk: ^0.1.0-beta copied to clipboard

The Everlink SDK for Flutter, token verification using ultrasound, allows apps developed using Flutter to use Everlink native SDKs to enable proximity verification.

Everlink Flutter SDK #

Allows apps developed using Flutter to use Everlink’s native SDKs to enable proximity verification via ultrasound.

Installation #

Android #

  • Edit android/build.gradle to look like this

    allprojects {
        repositories {
            ...
            google()
            mavenCentral()
    +       maven {
    +           url "https://repo.everlink.co/repository/maven-releases/"
    +       }
        }
    }
    

Usage #

  • Import everlink_sdk.dart

    import 'package:everlink_sdk/everlink_sdk.dart';
    
  • Initialize EverlinkSdk class passing it your appID key

    final everlinkSdk = EverlinkSdk("your appID key");
    
  • Set up event listener

    @override
    void initState() {
      super.initState();
      _listenToSdkEvents();
    }
    
    void _listenToSdkEvents() {
      _everlinkSdk.onEvent.listen((event) {
        if (event is GeneratedTokenEvent) {
          log('Generated token: Old - ${event.oldToken}, New - ${event.newToken}');
          //a new token generated, to save in your database
        } else if (event is DetectionEvent) {
          doSomethingWithDetectedToken(event.detectedToken);
          //you can now identify via the returned token what location/device was heard
        }
      }, onError: (error) {
        log('Error receiving SDK event: $error');
      });
    }
    
  • Detect code

    Future<void> everlinkStartDetecting() async {
    everlinkSdk.startDetecting();
    }
    Future<void> everlinkStopDetecting() async {
    everlinkSdk.stopDetecting();
    }
    

    Note users will be prompted to grant microphone permission.

    On successful detection we will return the identifying token of the heard device via the everlink_sdk_event EventChannel broadcast stream.

    ‍You can now search your database or locally using the returned Everlink unique identifying token to find the detected user. You might have some code like this:

    "SELECT * FROM employees WHERE everlink_token = token";
    }
    
  • Send code

    Future<void> everlinkStartEmitting() async {
      everlinkSdk.startEmitting();
    }
    Future<void> everlinkStopEmitting() async {
      everlinkSdk.stopEmitting();
    }
    

    This will cause the device to start emitting the audiocode of the latest token generated on the device.

    You can alternatively pass a token as an argument and its audiocode will play, as shown below:

    Future<void> everlinkStartEmittingToken(String token) async {
      everlinkSdk.startEmittingToken(token);
    }
    
  • Volume settings

    Function playVolume(volume, loudspeaker) allows you to set the volume and whether the audio should default to the loudspeaker.

    Future<void> everlinkPlayVolume(double volume, bool loudSpeaker) async {
      everlinkSdk.playVolume(volume, loudSpeaker);
    }
    

    We can detect if headphones are in use, and route the audio to the device’s loud speaker. Though users might experience a short pause in any audio they are listening to, while the audiocode is played, before we automatically resume playing what they were listening to before the interruption.

  • Create token

    If you wish to manually generate a new user token. Otherwise one will be automatically generated.

    Future<void> everlinkNewToken(String date) async {
      everlinkSdk.newToken(date);
    }
    

    On successful detection we will return the identifying token of the heard device via the everlink_sdk_event EventChannel broadcast stream.

    Function newToken(startDate) takes a validity start date in the form 'YYYY-MM-DD’. The token will be valid for two weeks after this date. If no validity date is provided then it will be the current date. Once a device token is expired it will automatically refresh.

  • Downloading tokens (needed if you want the SDK to work offline)

    Future<void> everlinSaveTokens(List<String> tokens) async {
      everlinkSdk.saveTokens(tokens);
    }
    

    For situations where it is possible to download your users' tokens prior to detecting, we strongly recommend that you do. This will reduce latency and make the verification faster and more reliable.


To learn more, read this.

1
likes
0
points
18
downloads

Publisher

verified publishereverlink.co

Weekly Downloads

The Everlink SDK for Flutter, token verification using ultrasound, allows apps developed using Flutter to use Everlink native SDKs to enable proximity verification.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on everlink_sdk

Packages that implement everlink_sdk