From fd06247b067c5d583858a96a3bcbccda4b39af8d Mon Sep 17 00:00:00 2001 From: P Niraula
Date: Wed, 8 Jun 2016 21:40:16 -0400 Subject: [PATCH] Updated some comments and added resume option for android --- src/plugins/backgroundmode.ts | 41 +++++++++++++++-------------------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/src/plugins/backgroundmode.ts b/src/plugins/backgroundmode.ts index 231b6a4de..75ba0aa4d 100644 --- a/src/plugins/backgroundmode.ts +++ b/src/plugins/backgroundmode.ts @@ -4,7 +4,12 @@ import {Plugin, Cordova} from './plugin'; * @name Background Mode * @description * Cordova plugin to prevent the app from going to sleep while in background. -* For more info about plugin, vist: https://github.com/katzer/cordova-plugin-background-mode#android-customization +* Requires Cordova plugin: cordova-plugin-background-mode. For more info about plugin, vist: https://github.com/katzer/cordova-plugin-background-mode#android-customization +*@usage +* ```js +* import {BackgroundMode} from 'ionic-native'; +* +* BackgroundMode.enable(); */ @Plugin({ plugin: 'de.appplant.cordova.plugin.background-mode', @@ -44,14 +49,18 @@ export class BackgroundMode { * Override the default title, ticker and text. * Available only for Android platform. */ - @Cordova() - static setDefaults(options?:Defaults):void{} + @Cordova({ + platforms: ['Android'] + }) + static setDefaults(options?:Configure):void{} /** * Modify the displayed information. * Available only for Android platform. */ - @Cordova() + @Cordova({ + platforms: ['Android'] + }) static update(options?:Configure):void{} /** * Sets a callback for a specific event @@ -63,26 +72,7 @@ export class BackgroundMode { }) static on(eventName: string, callback: any): void {} } -/** -*Default configurations avaialable only on Android -*/ -export interface Defaults{ - /** - *Title of the background task - */ - title?: String; - /** - *The text that scrolls itself on statusbar - */ - ticker?: String; - - /** - *Description of background task - */ - text?: String; - -} /** * Configurations items that can be updated. */ @@ -107,4 +97,9 @@ export interface Configure{ */ silent?:boolean; + /** + *Boolean. By default the app will come to foreground when taping on the notification. If false, plugin wont come to foreground when tapped. + */ + resume?:boolean; + }