0.1.1 • Published 7 years ago

nativescript-safetynet-helper v0.1.1

Weekly downloads
6
License
MIT
Repository
github
Last release
7 years ago

NativeScript SafetyNet Helper

A NativeScript module for checking device integrity using the SafetyNet API. It uses the SafetyNet Helper library

Installation

From the command prompt go to your app's root folder and execute:

tns plugin add nativescript-safetynet-helper

Usage

Here are the supported functions:

function: requestTest

JavaScript

let SafetyNetHelper = require('nativescript-safetynet-helper').SafetyNetHelper

let helper = new SafetyNetHelper(this._apiKey)

helper.requestTest((err, result) => {
    if (err) {
        console.log(err)
        this.updateMessage(err);
        return
    }

    console.log(`Basic Integrity - ${result.basicIntegrity}, CTS Profile Match - ${result.ctsProfileMatch}`)
});

TypeScript

import { SafetyNetHelper } from 'nativescript-safetynet-helper';

let helper = new SafetyNetHelper(this._apiKey)

helper.requestTest((err, result) => {
    if (err) {
        console.log(err)
        this.updateMessage(err);
        return
    }

    console.log(`Basic Integrity - ${result.basicIntegrity}, CTS Profile Match - ${result.ctsProfileMatch}`)
});

Thanks

Scott Alexander-Bown for his contributions to SafetyNet Helper