mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-03-04 00:13:06 +08:00
feat(system-alert-window-permission): add plugin (#3659)
This commit is contained in:
parent
443515582b
commit
50f8a452ad
@ -0,0 +1,68 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
|
||||
/**
|
||||
* @name System Alert Window Permission
|
||||
* @description
|
||||
* This plugin does something
|
||||
*
|
||||
* @usage
|
||||
* ```typescript
|
||||
* import { SystemAlertWindowPermission } from '@ionic-native/system-alert-window-permission/ngx';
|
||||
*
|
||||
*
|
||||
* constructor(private systemAlertWindowPermission: SystemAlertWindowPermission) { }
|
||||
*
|
||||
* ...
|
||||
*
|
||||
*
|
||||
* this.systemAlertWindowPermission.hasPermission()
|
||||
* .then((res: any) => console.log(res))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* this.systemAlertWindowPermission.requestPermission()
|
||||
* .then((res: any) => console.log(res))
|
||||
* .catch((error: any) => console.error(error));
|
||||
*
|
||||
* ```
|
||||
*/
|
||||
|
||||
@Plugin({
|
||||
pluginName: 'SystemAlertWindowPermission',
|
||||
plugin: 'cordova-plugin-system-alert-window-permission',
|
||||
pluginRef: 'window.systemAlertWindowPermission',
|
||||
repo: 'https://github.com/MaximBelov/cordova-plugin-system-alert-window-permission.git',
|
||||
install: 'ionic cordova plugin add cordova-plugin-system-alert-window-permission',
|
||||
platforms: ['Android']
|
||||
})
|
||||
@Injectable()
|
||||
export class SystemAlertWindowPermission extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Check permission
|
||||
* @return {Promise<any>} return 0 when dont have SYSTEM_ALERT_WINDOW permission, 1 when have SYSTEM_ALERT_WINDOW permission
|
||||
*/
|
||||
@Cordova()
|
||||
hasPermission(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Request permission
|
||||
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||
*/
|
||||
@Cordova()
|
||||
requestPermission(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Open notification Settings
|
||||
* @return {Promise<any>} Returns a promise that resolves when something happens
|
||||
*/
|
||||
@Cordova()
|
||||
openNotificationSettings(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user