mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-19 08:32:52 +08:00
feat(restart): add plugin (#3657)
This commit is contained in:
parent
065e80cccf
commit
575229412b
50
src/@ionic-native/plugins/restart/index.ts
Normal file
50
src/@ionic-native/plugins/restart/index.ts
Normal file
@ -0,0 +1,50 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @name Restart
|
||||
* @description
|
||||
* This plugin to restart android application
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { Restart } from '@ionic-native/restart';
|
||||
*
|
||||
*
|
||||
* constructor(private restart: Restart) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
*
|
||||
* this.restart.restart(true)
|
||||
* .then((res: any) => console.log(res))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
@Plugin({
|
||||
pluginName: 'Restart',
|
||||
plugin: 'cordova-plugin-restart',
|
||||
pluginRef: 'RestartPlugin',
|
||||
repo: 'https://github.com/MaximBelov/cordova-plugin-restart',
|
||||
install: 'ionic cordova plugin add cordova-plugin-restart',
|
||||
platforms: ['Android']
|
||||
})
|
||||
@Injectable()
|
||||
export class Restart extends IonicNativePlugin {
|
||||
@Cordova({
|
||||
errorIndex: 0,
|
||||
successIndex: 2
|
||||
})
|
||||
restart(cold: boolean): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
@Cordova({
|
||||
errorIndex: 0,
|
||||
})
|
||||
enableDebug(): Promise<any>{
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user