mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-19 08:32:52 +08:00
feat(plugin): add MS App Center LowMemory plugin (#3619)
* feat(plugin): add MS App Center LowMemory plugin * refactor(app-center-low-memory): plugin decorator
This commit is contained in:
parent
46d0cecb27
commit
2cb5f5c010
41
src/@ionic-native/plugins/app-center-low-memory/index.ts
Normal file
41
src/@ionic-native/plugins/app-center-low-memory/index.ts
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @name App Center Low Memory
|
||||||
|
* @description
|
||||||
|
* Generates a low memory warning.
|
||||||
|
* For more info, please see: https://github.com/Microsoft/appcenter-sdk-cordova/tree/master/cordova-plugin-appcenter-generate-low-memory
|
||||||
|
*
|
||||||
|
* @usage
|
||||||
|
* ```typescript
|
||||||
|
* import { LowMemory } from '@ionic-native/app-center-low-memory/ngx';
|
||||||
|
*
|
||||||
|
* ...
|
||||||
|
*
|
||||||
|
* constructor(private lowMemory: LowMemory) { }
|
||||||
|
*
|
||||||
|
* async warning() {
|
||||||
|
* await this.lowMemory.generateLowMemory();
|
||||||
|
* }
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
|
@Plugin({
|
||||||
|
pluginName: 'LowMemory',
|
||||||
|
plugin: 'https://github.com/Microsoft/appcenter-sdk-cordova/tree/master/cordova-plugin-appcenter-generate-low-memory',
|
||||||
|
pluginRef: 'LowMemory',
|
||||||
|
repo: 'https://github.com/Microsoft/appcenter-sdk-cordova/tree/master/cordova-plugin-appcenter-generate-low-memory',
|
||||||
|
platforms: ['Android', 'iOS'],
|
||||||
|
})
|
||||||
|
@Injectable()
|
||||||
|
export class LowMemory extends IonicNativePlugin {
|
||||||
|
/**
|
||||||
|
* Generates a low memory warning.
|
||||||
|
* For more info, please see: https://github.com/Microsoft/appcenter-sdk-cordova/tree/master/cordova-plugin-appcenter-generate-low-memory
|
||||||
|
* @returns {Promise<void>}
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
generateLowMemory(): Promise<void> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user