# cordova-plugin-gpsmockchecker

> This is a cordova plugin to avoid mock locations.

Latest version **1.0.5** (published 2019-06-04) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install cordova-plugin-gpsmockchecker
pnpm add cordova-plugin-gpsmockchecker
yarn add cordova-plugin-gpsmockchecker
bun add cordova-plugin-gpsmockchecker
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2019-06-04 |
| First published | 2019-06-04 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 18.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Sunflower Energias SL |
| Maintainers | sunflowerenergias |
| Keywords | ecosystem:cordova, cordova-android, cordova plugin, cordova gps, mock, location, checker, mock-location, mock gps |

## Links

- npm: https://www.npmjs.com/package/cordova-plugin-gpsmockchecker
- Repository: https://github.com/sunflowerenergias/cordova-plugin-gpsmockchecker
- Homepage: https://github.com/sunflowerenergias/cordova-plugin-gpsmockchecker#readme
- Issues: https://github.com/sunflowerenergias/cordova-plugin-gpsmockchecker/issues
- npm.io page: https://npm.io/package/cordova-plugin-gpsmockchecker

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.5 (latest) — 2019-06-04
- 1.0.4 — 2019-06-04
- 1.0.3 — 2019-06-04
- 1.0.2 — 2019-06-04

## README

# cordova-plugin-gpsmockchecker

This is a cordova plugin to avoid mock locations.

This plugin get mock location in Android api <= 22 AND api > 22

You can choose a white list of packages.

## Supported Platforms

- Android API all versions

## Installation

```bash
cordova plugin add cordova-plugin-gpsmockchecker
```

## Usage in typescript / ionic

```js
    this.platform.ready().then(() => {

      var whiteList = ['com.package.example','com.package.example2'];

      (<any>window).gpsmockchecker.check(whiteList, (result) => {
        
        console.log(result);

        if(result.isMock){
            console.log("DANGER!! Mock is in use");
            console.log("Apps that use gps mock: ");
            console.log(result.mocks);
        }
        else
          console.log("All its ok");
  
  
      }, (error) => console.log(error));
      
    });
```


## Usage in javascript

```js

document.addEventListener("deviceready", onDeviceReady, false);

function onDeviceReady() {  
  var whiteList = ['com.package.example','com.package.example2'];
  mockchecker.check(whiteList, successCallback, errorCallback);
}

function successCallback(mockStatus) {
  console.log(mockStatus);
}

function errorCallback(error) {
  console.log(error);
}
```

## mockStatus

Contains mock status :

### properties

- isMock : (boolean) true if device mock, false if no mock behavior detected.
- mocks : (array) return APPs using mock.

---
_Source: https://npm.io/package/cordova-plugin-gpsmockchecker · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
