fs_anti_theft_flutter 1.0.6+1 copy "fs_anti_theft_flutter: ^1.0.6+1" to clipboard
fs_anti_theft_flutter: ^1.0.6+1 copied to clipboard

unlisted

Package do antitheft.

Anti Theft Plugin #

Device Security plugin for flutter

Supported platforms #

  • iOS
  • Android

Prerequisites #

  • iOS 13+
  • Android API Level 28

Getting Started
#

Add dependecy in your pubspec.yaml file

dependencies:
  fs_anti_theft_flutter:
    git:
      url: https://bitbucket.org/daffodilsoftware/fs_anti_theft_flutter.git
      ref: "8482043"

Add source cocoapods in your /iOS/Podfile file

  pod 'FSAntiTheftSDK',:git=>'https://Raman_Srivastava@bitbucket.org/raman_srivastava/fsantitheftsdk.git', :commit => '42e2b82'

Add keys in your /iOS/Runner/info.plist file

Add credentials for maven in your /android/build.gradle file

allprojects {
    repositories {
        google()
        mavenCentral()
        maven {
            url "http://119.8.144.233:8082/artifactory/com-antitheft-local/"
            credentials{
                username = "admin"
                password = "Testtest1."
            }
            authentication {
                basic(BasicAuthentication)
            }
        }
    }
}

Add in dependencies in your /android/app/build.gradle file

dependencies {
    implementation "br.com.vistoriaremota.app:antitheftsdk:0.2.28"
}

To register device on portal SDK

import 'package:fs_anti_theft_flutter/fs_anti_theft_flutter.dart';

Future<bool> startLoginToSDK() async {
  try{
    var args = {
      "BASE_URL":"https://prod.protecaopix.com.br",
      "APPLICATION_ID": "ayGMxEcU7hA5E7uZshPcSM",
      "ANTI_THEFT_API_KEY": "381bb4ee-7ef9-48c9-92be-d9ff05a9364d",
      "VERSION_NAME": "",
      "EMAIL": "devansh.mathur@unthinkable.co",
      "MOBILE": "5511958781603",
      "IMEI": "EXAMPLE_IMEI",
      "ANDROID_PACKAGE_NAME": "br.com.fs.fs_anti_theft_flutter_example"
    };
    var check = await FsAntiTheftPlugin.startLoginToSDK(arguments: args);
    print('Anti-theft Registration ${check ? Successful : Failed}');
    return check;
  } catch (e) {
    print('Anti-theft Registration Failed');
  }
  return false;
}

To check the registration status of device

import 'package:fs_anti_theft_flutter/fs_anti_theft_flutter.dart';

Future<bool> isDeviceRegistered() {
     try{
        var args = {
            "BASE_URL":"https://prod.protecaopix.com.br",
            "APPLICATION_ID": "ayGMxEcU7hA5E7uZshPcSM",
            "ANTI_THEFT_API_KEY": "381bb4ee-7ef9-48c9-92be-d9ff05a9364d",
            "IMEI": "EXAMPLE_IMEI",
            "ANDROID_PACKAGE_NAME": "br.com.fs.fs_anti_theft_flutter_example"
        };
        var check = await FsAntiTheftPlugin.isDeviceRegistered(arguments: args);
        print('Device ${check ? already : not} Registered');
        return check;
    } catch (e) {
      print('Device not Registered');
    }
    return false;
}

Permission Enum #

enum EnumPermissionsName {
  location,         // Both android and iOS
  camera,           // Both android and iOS
  adminAccess,      // Only for android
  screenOverlay,    // Only for android
  notification,     // Only for iOS
  accessibility,    // Only for android
}

To check all the permissions

import 'package:fs_anti_theft_flutter/fs_anti_theft_flutter.dart';

Future<Map<EnumPermissionsName, bool>> checkAllPermission() async {
    var permissionStatus = await FsAntiTheftPlugin.isDeviceRegistered();
    return permissionStatus;
}

To check specific permissions

import 'package:fs_anti_theft_flutter/fs_anti_theft_flutter.dart';

Future<bool> checkPermission({
    required EnumPermissionsName permissionName,
  }) async {
    var permissionStatus = await FsAntiTheftPlugin.checkPermission(permissionName: permissionName);
    return permissionStatus;
}

To request all the permissions

import 'package:fs_anti_theft_flutter/fs_anti_theft_flutter.dart';

Future<void> requestAllPermission({
    bool askAccessibilityPer = true,
}) async {
    var permissionStatus = await FsAntiTheftPlugin.requestAllPermission(askAccessibilityPer: true);
}

To request specific permissions

import 'package:fs_anti_theft_flutter/fs_anti_theft_flutter.dart';

Future<void> requestPermission({
    required EnumPermissionsName permissionName,
}) async {
    var permissionStatus = await FsAntiTheftPlugin.requestPermission(permissionName: permissionName);
}

Funcoes nativas ios e android expostas para serem chamada pelo flutter


enum EnumActions {
  alarmOn,  // liga o alarme
  alarmOff, // desliga o alarme
  location, // pega a localização
  camera, // liga a camera
  remoteLoking, // bloqueia a tela do celular
  remoteUnloking, // desbloqueia o celular
  remoteLockWithoutOverride, //
  remoteWipe, // formata o celular
}

// Exemplo para chamada do alarme
await FsAntiTheftPlugin.actionAntitheft(action: EnumActions.alarmOn)

// Exemplo para desligar o alarme
await FsAntiTheftPlugin.actionAntitheft(action: EnumActions.alarmOff)
0
likes
0
pub points
61%
popularity

Publisher

unverified uploader

Package do antitheft.

License

unknown (license)

Dependencies

flutter, permission_handler

More

Packages that depend on fs_anti_theft_flutter