flutter_shieldfraud 1.0.0 copy "flutter_shieldfraud: ^1.0.0" to clipboard
flutter_shieldfraud: ^1.0.0 copied to clipboard

outdated

Flutter plugin for Shield SDK. SHIELD SDK helps developers to assess malicious activities performed on mobile devices and return risk intelligence based on user's behaviour.

example/lib/main.dart

import 'dart:collection';
import 'package:flutter/material.dart';
import 'package:flutter_shieldfraud/plugin_shieldfraud.dart';
import 'package:flutter_shieldfraud/shield_config.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {

  @override
  void initState(){
    super.initState();
    ShieldCallback shieldCallback =
        ShieldCallback((Map<String, dynamic> result) {
      print("callback result: $result");
    }, (ShieldError error) {
      print("callback error: ${error.message}");
    });

    ShieldConfig config = ShieldConfig(siteID: "dda05c5ddac400e1c133a360e2714aada4cda052", key: "9ce44f88a25272b6d9cbb430ebbcfcf1",
        shieldCallback:  shieldCallback, enableShieldProcess: true);
    Shield.initShield(config);

    Shield.sessionId
        .then((sessionId) => print("shield sessionId: $sessionId"));

    Map<String, String> data = HashMap();
    data["user_id"] = "123";
    data["email"] = "test@gmail.com";
    Shield.sendAttributes("test", data)
        .then((value) => print("successfully sent attributes: $value"));


    Shield.latestDeviceResult
        .then((latestDeviceResult) => {
          if (latestDeviceResult == null) {
            print( "error ${Shield.latestError?.message}")
          } else {
            print("result $latestDeviceResult")
          }
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: MaterialButton(onPressed: () {
            var attributes = {"user_id":"123", "email": "testing"};
            Shield.sendAttributes("main", attributes)
            .then((value) => print("successfully sent: $value"));
          }, child: const Text("Send attributes"),)
        ),
      ),
    );
  }
}
4
likes
0
pub points
68%
popularity

Publisher

unverified uploader

Flutter plugin for Shield SDK. SHIELD SDK helps developers to assess malicious activities performed on mobile devices and return risk intelligence based on user's behaviour.

Homepage

License

unknown (license)

Dependencies

flutter

More

Packages that depend on flutter_shieldfraud