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:
John Borges 2021-04-05 17:31:14 -04:00 committed by GitHub
parent 46d0cecb27
commit 2cb5f5c010
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View 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;
}
}