Starts a foregrounding service which increases the process prority to prevent AMP Hybrid Client from being killed by the Android operating system, e.g when the user is gathering data to be entered in a form.
Once started, the foreground service can be stopped using the stopKeepAlive
method.
Under normal operating conditions, the foregrounding service starts automatically once an external activity is opened, which reduces a risk of the client being terminated. When this happens, the following notification is displayed: “Waiting for an external action to finish". After returning to the client, the service closes.
On iOS, this method has no effect.
Name | Description | Type | Use |
---|---|---|---|
message | Includes a message to be displayed in the device's notification area. | string |
required |
timeout | Sets a time after which the foreground service is automatically terminated (in seconds).
Calling the
|
integer |
optional |