API
Class

cordova-plugin-background-mode (cordova-plugin-background-mode)

使用范围:Native

Contents

class cordova-plugin-background-mode (cordova-plugin-background-mode)

app后台运行插件

Constructor Top

  cordova-plugin-background-mode ()

Static Methods Top

void configure (Object options)
void disable ()
void enable ()
Object getDefaults ()
Boolean isActive ()
Boolean isEnabled ()
void onactivate ()
void ondeactivate ()
void onfailure (Integer errorCode)
void setDefaults (Object options)

Constructor details Top

public cordova-plugin-background-mode ()

app后台运行插件

Static Methods Detail Top

static public void configure (Object options)

配置

Parameters

Object options

配置参数

Return Value

void

static public void disable ()

设置app后台模式禁用

Return Value

void

static public void enable ()

设置app后台模式启用

Return Value

void

static public Object getDefaults ()

获取默认配置

Return Value

Object

static public Boolean isActive ()

返回后台模式是否激活的信息

Return Value

Boolean

static public Boolean isEnabled ()

返回后台运行模式是否允许的信息

Return Value

Boolean

static public void onactivate ()

app后台运行模式激活,调用该方法需重写该方法的实现

Return Value

void

static public void ondeactivate ()

app后台运行模式禁用的时候激活,调用该方法需重写该方法的实现

Return Value

void

static public void onfailure (Integer errorCode)

app后台运行模式不能被激活时触发,调用该方法需重写该方法的实现

Parameters

Integer errorCode

错误码

Return Value

void

static public void setDefaults (Object options)

设置默认配置

Parameters

Object options

配置参数
参数结构如下

{ "title" : ... "text" : ... "ticker" : ... "resume" : ... "silent" : ... }

Return Value

void