public class HeadlessJsTaskConfig
extends java.lang.Object
Constructor and Description |
---|
HeadlessJsTaskConfig(java.lang.String taskKey,
WritableMap data)
Create a HeadlessJsTaskConfig.
|
HeadlessJsTaskConfig(java.lang.String taskKey,
WritableMap data,
long timeout)
Create a HeadlessJsTaskConfig.
|
HeadlessJsTaskConfig(java.lang.String taskKey,
WritableMap data,
long timeout,
boolean allowedInForeground)
Create a HeadlessJsTaskConfig.
|
public HeadlessJsTaskConfig(java.lang.String taskKey, WritableMap data)
HeadlessJsTaskConfig(String, WritableMap, long, boolean)
with no timeout (0) and
false
for allowedInBackground
.public HeadlessJsTaskConfig(java.lang.String taskKey, WritableMap data, long timeout)
HeadlessJsTaskConfig(String, WritableMap, long, boolean)
with false
for
allowedInBackground
.public HeadlessJsTaskConfig(java.lang.String taskKey, WritableMap data, long timeout, boolean allowedInForeground)
taskKey
- the key for the JS task to execute. This is the same key that you call AppRegistry.registerTask
with in JS.data
- a map of parameters passed to the JS task executor.timeout
- the amount of time (in ms) after which the React instance should be terminated
regardless of whether the task has completed or not. This is meant as a safeguard against
accidentally keeping the device awake for long periods of time because JS crashed or some
request timed out. A value of 0 means no timeout (should only be used for long-running tasks
such as music playback).allowedInForeground
- whether to allow this task to run while the app is in the foreground
(i.e. there is a host in resumed mode for the current ReactContext). Only set this to true if
you really need it. Note that tasks run in the same JS thread as UI code, so doing expensive
operations would degrade user experience.