# Flutter SDK

Flutter SDK is a software development kit (SDK) used for building high-performance, high-fidelity mobile applications for iOS, Android, and the web from a single codebase.

## Features

**Simplified Security:** We make it simple for you to collect sensitive data such as device information of users.<br>

## Requirements

### **Android**

This plugin requires several changes to be able to work on Android devices. Please make sure you follow all these steps:

1. Use Android 6.0 (API level 23) and above.
2. Use Kotlin version 1.6.10 and above:  example `ext.kotlin_version = '1.6.10'`
3. Using an up-to-date Android gradle build tools version and an up-to-date gradle version accordingly.

### **iOS**

This plugin requires several configurations to be able to work on iOS. Please make sure you have those requirement:

1. Compatible with apps targeting iOS 9.0 and above.
2. Use Swift version 5.0 and above

### Step 1 - Add Dependency

In the  `dependencies:` section of your `pubspec.yaml` add the following line:&#x20;

```
tutelarfluttersdk 1.0.1
```

### Step 2 - Initialize SDK

Add the following line of code to initialise it with the api key you obtained from the Tutelar merchant panel. If you don’t have an api key, create a new one.

```
Tutelar tutelar = Tutelar("YOUR API KEY");
```

### Step 3 - Getting Device Info

By calling the following function to receive the device info shown below

```
var sdkResponse = await tutelar.getDeviceDetails();
if(sdkResponse['success'] == true){
    var deviceDetail = response['data'];
    // Handle Success flow
}else{
    var failureMessage = response['message'];
     // Handle Failure flow
}
```

### Step 4 - Update Permission for iOS

If you are working with iOS Build, You have to add this permission in Info.plist

```
// This is probably the only one you need. Background location is supported
// when the app is using location service while in the background.
NSLocationWhenInUseUsageDescription
```

**Step 5 - Proguard Rules (optional)**

If you are using Proguard for your builds, modify the Proguard rule file:

```
-keep,allowobfuscation,allowshrinking interface retrofit2.Call
-keep,allowobfuscation,allowshrinking class retrofit2.Response
-keep,allowobfuscation,allowshrinking class kotlin.coroutines.** { *; }

-dontwarn com.tutelarfluttersdk.**
-keep class com.tutelarfluttersdk.** {*;}
```

### Sample Device Fingerprint Data

```json
{
        "status": true,
        "device": {
            "deviceId": "7edb5cf527d4b8b9",
            "platform": "a32x",
            "is_real_device": true,
            "deviceCharging": false,
            "batteryLevel": "61",
            "devicePixelRatio": "720 x 1457",
            "screenWidth": "720",
            "screenHeight": "1457",
            "touchSupport": true,
            "deviceMemory": "5.81 GB",
            "os": "Android TIRAMISU",
            "deviceTypes": {
                "isMobile": true,
                "isDesktop": false,
                "isLinux": false,
                "isLinux64": false,
                "isMac": false,
                "isSmartTV": false,
                "isTablet": false,
                "isWindows": false,
                "isiPad": false,
                "isiPhone": false,
                "isiPod": false
            },
            "displayResolution": "720 x 1457",
            "audioHardware": {
                "hasSpeakers": true
            },
            "microPhoneHardware": {
                "hasMicrophone": true
            },
            "videoHardware": {
                "hasWebCam": true
            },
            "android_id": "TP1A.220624.014",
            "board": "a32x",
            "brand": "samsung",
            "display": "TP1A.220624.014.M326BDDU4CVK1",
            "boot_loader": "M326BDDU4CVK1",
            "finger_print": "samsung/a32xins/a32x:13/TP1A.220624.014/M326BDDU4CVK1:user/release-keys",
            "hardware": "mt6853",
            "host": "SWDK3808",
            "manufacturer": "samsung",
            "model": "SM-M326B",
            "product": "a32xins",
            "user": "dpi",
            "type": "user",
            "is_emulator": false,
            "ip_address": "172.18.24.158",
            "imei_number": "",
            "data_enabled": "",
            "serial_number": "",
            "network_type": "",
            "data_roaming": "",
            "root_status": false,
            "memory_information": {
                "total_memory": "5.81 GB",
                "available_memory": "3.40 GB",
                "used_memory": "2.41 GB"
            },
            "kernel_version": "4.14.186-25331340",
            "proximity_sensor": {
                "id": 0,
                "is_dynamic_sensor": false,
                "is_wakeup_sensor": true,
                "name": "Ear Hover Proximity Lite Sensor (ProToS Lite)",
                "resolution": 1.0,
                "type": 8,
                "string_type": "android.sensor.proximity",
                "reporting_mode": 1,
                "vendor": "Samsung Electronics.",
                "version": 1,
                "power": 0.75,
                "max_delay": 0,
                "min_delay": 0,
                "maximum_range": 5.0
            },
            "language_info": {
                "language": "en",
                "display_language": "English",
                "iso_3_language": "eng"
            },
            "country_info": {
                "country": "GB",
                "display_country": "United Kingdom",
                "iso_3_country": "GBR"
            },
            "system_storage": {
                "total": "4.73 GB",
                "used": "4.72 GB"
            },
            "external_storage": {},
            "screen_brightness": "193",
            "screen_size": "6.039358293217227",
            "developer_mode_enabled": true,
            "timestamp": 1673075519729,
            "timezone": "Asia/Kolkata",
            "deviceHash": "a7a67efe4ecaf181abfa181a7bad61d0"
        },
        "time": {
            "timestamp": 1673075519731,
            "timezone": "Asia/Kolkata"
        }
    }

```
