Skip to content

Commit

Permalink
feat(pin-check): add pin check plugin (#1734)
Browse files Browse the repository at this point in the history
* feat(plugin): pin check

* fix(plugin) pluginRef fixed
  • Loading branch information
Nicolas Naso authored and ihadeed committed Jul 3, 2017
1 parent 7cb95f1 commit b8ac7bf
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions src/@ionic-native/plugins/pin-check/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core';
import { Injectable } from '@angular/core';

/**
* @name Pin Check
* @description
* This plugin is for use with Apache Cordova and allows your application to check whether pin/keyguard or passcode is setup on iOS and Android phones.
*
* Requires Cordova plugin: cordova-plugin-pincheck. For more info, please see the [PinCheck plugin docs](https://github.com/ohh2ahh/AppAvailability).
*
* @usage
* ```typescript
* import { PinCheck } from '@ionic-native/pin-check';
* import { Platform } from 'ionic-angular';
*
* constructor(private pinCheck: PinCheck, private platform: Platform) { }
*
* ...
*
* this.pinCheck.isPinSetup()
* .then(
* (success: string) => console.log("pin is setup.");,
* (error: string) => console.log("pin not setup.");
* );
* ```
*/
@Plugin({
pluginName: 'PinCheck',
plugin: 'cordova-plugin-pincheck',
pluginRef: 'cordova.plugins.PinCheck',
repo: 'https://github.com/shangyilim/cordova-plugin-pincheck',
platforms: ['Android', 'iOS']
})
@Injectable()
export class PinCheck extends IonicNativePlugin {
/**
* check whether pin/keyguard or passcode is setup
* @returns {Promise<boolean>}
*/
@Cordova()
isPinSetup(): Promise<boolean> {
return;
}
}

0 comments on commit b8ac7bf

Please sign in to comment.