Inherits from NSObject
Declared in ForgeTask.h
ForgeTask.m

Overview

A ForgeTask contains details about a native API call from Javascript, and has several helper methods to perform common tasks from a native API call.

Tasks

Instance Methods

error:type:subtype:

Return an error to Javascript.

- (void)error:(NSString *)message type:(NSString *)type subtype:(NSString *)subtype

Parameters

message

Human readable error message

type

One of UNEXPECTED_FAILURE, EXPECTED_FAILURE, UNAVAILABLE or BAD_INPUT

subtype

An easily matchable error code for errors that need to be programmatically filtered

Declared In

ForgeTask.m

runInBackground

Inform the device that this task should be allowed to continue in the background.

- (void)runInBackground

Discussion

The task many still be paused if it takes longer than 10 minutes or for other reasons.

Declared In

ForgeTask.m

success:

Return success with a result to Javascript for the task

- (void)success:(id)result

Parameters

result

A JSON serializable object to return

Declared In

ForgeTask.m