Updated some comments and added resume option for android

This commit is contained in:
P Niraula 2016-06-08 21:40:16 -04:00
parent 397515274b
commit fd06247b06

View File

@ -4,7 +4,12 @@ import {Plugin, Cordova} from './plugin';
* @name Background Mode * @name Background Mode
* @description * @description
* Cordova plugin to prevent the app from going to sleep while in background. * 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({
plugin: 'de.appplant.cordova.plugin.background-mode', plugin: 'de.appplant.cordova.plugin.background-mode',
@ -44,14 +49,18 @@ export class BackgroundMode {
* Override the default title, ticker and text. * Override the default title, ticker and text.
* Available only for Android platform. * Available only for Android platform.
*/ */
@Cordova() @Cordova({
static setDefaults(options?:Defaults):void{} platforms: ['Android']
})
static setDefaults(options?:Configure):void{}
/** /**
* Modify the displayed information. * Modify the displayed information.
* Available only for Android platform. * Available only for Android platform.
*/ */
@Cordova() @Cordova({
platforms: ['Android']
})
static update(options?:Configure):void{} static update(options?:Configure):void{}
/** /**
* Sets a callback for a specific event * Sets a callback for a specific event
@ -63,26 +72,7 @@ export class BackgroundMode {
}) })
static on(eventName: string, callback: any): void {} 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. * Configurations items that can be updated.
*/ */
@ -107,4 +97,9 @@ export interface Configure{
*/ */
silent?:boolean; 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;
} }