A NativeScript module for checking device integrity using the SafetyNet API. It uses the SafetyNet Helper library
From the command prompt go to your app's root folder and execute:
tns plugin add nativescript-safetynet-helper
Here are the supported functions:
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}`)
});
Scott Alexander-Bown for his contributions to SafetyNet Helper