Container


Purpose

Represents the Hybrid Container's container object, which is the topmost element of the public JavaScript API.

The object can be accessed using the launchbox.Container reference.

Module

This object belongs to the Base product module.

Properties

Name Description Type
badge

This property is iOS-specific. Badge value is the number set as the badge of the app icon on the home screen to indicate the number of notifications pending for this app. Setting this property to 0 causes the badge on the app icon disappear.

Note

Due to a limitation in iOS, setting this parameter to 0 programatically clears all pending notifications from the Notification Center.

number
deviceId A unique device identifier. It is generated while the application is being installed on the device, therefore it may be different for each user of this device. Also, it may be different for each application on this device. In most cases it will be different for each device on which the same user is running the same application. In most cases it will not change when the application is stopped and started again. string
deviceModel

Model name of the device.

string
deviceManufacturer

The name of the device's manufacturer.

string
keepScreenOn

Decides whether the screen should remain on at all times. The parameter's value is set on the native side through the JavaScript bridge. The value is cached by the JavaScript.

boolean
nativeAppId The name of the native application. On Android the name is package name. On iOS thename is bundle id. string
networkStatus

The object provides information about the state of the network connection. It is updated automatically as the value changes on the device. The object's value is cached by the JavaScript.

object
osName

The name of the operating system.

string
osVersion

The version of the operating system.

string
version

The version of Hybrid Container. This property is logged in JavaScript using plain console log.

string

Note

The keepScreenOn, nativeAppId and version properties are available on Android and iOS platforms only.

Methods

Name Description Return type
addLifecycleListener

Registers any of various lifecycle callbacks. It is used to establish the status of either the Hybrid Container or the web application.

undefined
removeLifecycleListener

Removes a listener used to pass various lifecycle callbacks.

undefined
getPlatformSpecificDeviceId

Obtains a value of the deviceId property of specific type.

undefined
shutdown

Instantly kills the container object, which closes the Hybrid Container.

undefined
startKeepAlive

Starts a foregrounding service which increases the process prority to prevent Hybrid Container from being killed by the Android operating system, e.g when the user is gathering data to be entered in a form.

undefined
stopKeepAlive

Stops a foregrounding service that has been started using the startKeepAlive method to prevent Hybrid Container from being killed by the Android operating system.

undefined

Note

The methods addLifecycleListener and removeLifecycleListener are available on Android and iOS platforms only.

Callback methods

Name Description Return type
onOpenURL

An observer event that needs to be added to the onLaunchboxLoaded method, because when Hybrid Container is started by opening a custom URL, the event is delivered right after onLaunchboxLoaded call.

undefined

Related topics

Public API reference
Legal notice | Copyright © 2016 and Confidential to Pegasystems Inc. All rights reserved
PDN | Hybrid Container | Feedback
Advanced...