Class: AppManager

AppManager


new AppManager()

The class representing dapp manager for launcher.

Source:

Members


AuthorityStatus :number

Message type to send or receive.

Type:
  • number
Properties:
Name Type Default Description
NOINIT number 0

Not initialise

ASK number 1

Ask for authority.

ALLOW number 2

Allow the authority.

DENY number 3

Deny the authority.

Source:

MessageType :number

Message type to send or receive.

Type:
  • number
Properties:
Name Type Default Description
INTERNAL number 1

The internal message

IN_RETURN number 2

The internal return message.

EXTERNAL_LAUNCHER number 3

The external launcher message

EXTERNAL_INSTALL number 4

The external install message

EX_RETURN number 5

The external return message.

Source:

Methods


alertPrompt(title, message)

Display a alert dialog prompt.

Parameters:
Name Type Description
title string

The dialog title.

message string

The dialog message.

Source:

askPrompt(title, message, onOK)

Display a ask dialog prompt.

Parameters:
Name Type Description
title string

The dialog title.

message string

The dialog message.

onOK function

The function to call when click ok.

Source:

close(id, onSuccess [, onError])

Close a dapp by id.

Parameters:
Name Type Argument Description
id string

The dapp id.

onSuccess function

The function to call when success.

onError function <optional>

The function to call when error, the param is a String. Or set to null.

Source:

getAppInfo(id, onSuccess [, onError])

Get a dapp info.

Parameters:
Name Type Argument Description
id string

The dapp id.

onSuccess function

The function to call when success, the param is a AppInfo.

onError function <optional>

The function to call when error, the param is a String. Or set to null.

Source:

getAppInfos(onSuccess)

Get a dapp info.

Parameters:
Name Type Description
onSuccess function

The function to call when success, the param is include 'infos' and 'list'.

Source:

getAppList(onSuccess)

Get dapp list.

Parameters:
Name Type Description
onSuccess function

The function to call when success,the param is a dapp id list.

Source:

getLastList(onSuccess)

Get last run list.

Parameters:
Name Type Description
onSuccess function

The function to call when success,the param is a dapp id list.

Source:

getLocale(onSuccess)

Get locale.

Parameters:
Name Type Description
onSuccess function

The function to call.the param include 'defaultLang' and 'systemLang'.

Source:

getRunningList(onSuccess)

Get running list.

Parameters:
Name Type Description
onSuccess function

The function to call when success,the param is a dapp id list.

Source:

infoPrompt(title, message)

Display a info dialog prompt.

Parameters:
Name Type Description
title string

The dialog title.

message string

The dialog message.

Source:

install(url, onSuccess [, onError])

Install a dapp by path.

Parameters:
Name Type Argument Description
url string

The dapp install url.

onSuccess function

The function to call when success.the param is a AppInfo.

onError function <optional>

The function to call when error, the param is a String. Or set to null.

Source:

launcher(onSuccess [, onError])

Start the launcher.If the launcher running, it will be swith to curent.

Parameters:
Name Type Argument Description
onSuccess function

The function to call when success.

onError function <optional>

The function to call when error, the param is a String. Or set to null.

Source:

sendMessage(id, type, msg, onSuccess [, onError])

Send a message by id.

Parameters:
Name Type Argument Description
id string

The dapp id.

type MessageType

The message type.

msg string

The message content.

onSuccess function

The function to call when success.

onError function <optional>

The function to call when error, the param is a String. Or set to null.

Source:

setCurrentLocate(code, onSuccess [, onError])

Set current locale.

Parameters:
Name Type Argument Description
code string

The current locale code.

onSuccess function

The function to call when success.the param is a AppInfo.

onError function <optional>

The function to call when error, the param is a String. Or set to null.

Source:

setListener(callback)

Set listener for message callback.

Parameters:
Name Type Description
callback onReceiveMessage

The function receive the message.

Source:

setPluginAuthority(id, plugin, authority, onSuccess [, onError])

Set a plugin authority. Only the launcher can set.

Parameters:
Name Type Argument Description
id string

The dapp id.

plugin string

The plugin id to set authorty.

authority AuthorityStatus

The authority to set.

onSuccess function

The function to call when success.

onError function <optional>

The function to call when error, the param is a String. Or set to null.

Source:

setUrlAuthority(id, url, authority, onSuccess [, onError])

Set a url authority. Only the launcher can set.

Parameters:
Name Type Argument Description
id string

The dapp id.

url string

The url to set authority.

authority AuthorityStatus

The authority to set.

onSuccess function

The function to call when success.

onError function <optional>

The function to call when error, the param is a String. Or set to null.

Source:

start(id, onSuccess [, onError])

Start a dapp by id. If the dapp running, it will be swith to curent.

Parameters:
Name Type Argument Description
id string

The dapp id.

onSuccess function

The function to call when success.

onError function <optional>

The function to call when error, the param is a String. Or set to null.

Source:

unInstall(id, onSuccess [, onError])

Uninstall a dapp by id.

Parameters:
Name Type Argument Description
id string

The dapp id.

onSuccess function

The function to call when success.the param is the id.

onError function <optional>

The function to call when error, the param is a String. Or set to null.

Source: