Runs in the background, and can communicate with the foreground app.
Determine if the worker for the current app is running.
true if running
Launch the worker for the current app. Note that this is an asynchronous operation, a result code of APP_WORKER_RESULT_SUCCESS merely means that the request was successfully queued up.
result code
Kill the worker for the current app. Note that this is an asynchronous operation, a result code of APP_WORKER_RESULT_SUCCESS merely means that the request was successfully queued up.
result code
Subscribe to worker messages. Once subscribed, the handler gets called on every message emitted by the other task (either worker or app).
A callback to be executed when the event is received
true on success
Unsubscribe from worker messages. Once unsubscribed, the previously registered handler will no longer be called.
true on success
Send a message to the other task (either worker or app).
An application defined message type
the message data structure
Possible error codes from app_worker_launch, app_worker_kill.
Success.
No worker found for the current app.
A worker for a different app is already running.
The worker is not running.
The worker is already running.
The user will be asked for confirmation.
Callback type for worker messages. Messages can be sent from worker to app or vice versa.
An application defined message type
pointer to message data. The receiver must know the structure of the data provided by the sender.
Do you have questions about the Pebble SDK?
Do you need some help understanding something on this page?
You can either take advantage of our awesome developer community and check out the SDK Help forums, or you can send us a message through the website!