https://github.com/chimon2000/nativescript-safetynet-helper
https://github.com/chimon2000/nativescript-safetynet-helper
nativescript
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/chimon2000/nativescript-safetynet-helper
- Owner: chimon2000
- Created: 2017-03-14T20:48:39.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-15T17:01:32.000Z (over 9 years ago)
- Last Synced: 2025-10-12T06:54:27.558Z (8 months ago)
- Topics: nativescript
- Language: TypeScript
- Size: 1.87 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# NativeScript SafetyNet Helper
A [NativeScript](https://nativescript.org/) module for checking device integrity using the [SafetyNet API](https://developer.android.com/training/safetynet/index.html). It uses the [SafetyNet Helper](https://github.com/scottyab/safetynethelper) 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
```js
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
```ts
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](https://github.com/scottyab) for his contributions to [SafetyNet Helper](https://github.com/scottyab/safetynethelper)