diff --git a/src/plugins/backgroundmode.ts b/src/plugins/backgroundmode.ts index d9858877e..92fe6f0aa 100644 --- a/src/plugins/backgroundmode.ts +++ b/src/plugins/backgroundmode.ts @@ -113,24 +113,15 @@ export class BackgroundMode { static configure(options?: BackgroundModeConfiguration): Promise { return; } /** - * Called when background mode is activated. - * @returns {Observable} returns an observable that emits when background mode is activated - */ - @CordovaFunctionOverride() - static onactivate(): Observable { return; }; - - /** - * Called when background mode is deactivated. - * @returns {Observable} returns an observable that emits when background mode is deactivated - */ - @CordovaFunctionOverride() - static ondeactivate(): Observable { return; }; - - /** - * Called when background mode fails - * @returns {Observable} returns an observable that emits when background mode fails - */ - @CordovaFunctionOverride() - static onfailure(): Observable { return; }; + * Listen for events that the plugin fires. Available events are `enable`, `disable`, `activate`, `deactivate` and `failure`. + * @param event {string} Event name + * @returns {Observable} + */ + @Cordova({ + observable: true, + clearFunction: 'un', + clearWithArgs: true + }) + static on(event: string): Observable { return; } }