OptionalcomponentsThe Clay components the page hook's rows are drawn with, such as the plugin sources' note. The app registers each one before the page opens when the page holds a row of its type, and takes it off again on an open whose page holds none. A feature that brings them keeps them out of the bundle of any face that never uses the feature.
OptionalrequestsThe watch's request keys this feature answers, by name, such as WEATHER_REQUEST. The app logs one warning for a request no listed feature answers, which is how a face that declares a feature's keys but never opted into it finds out.
OptionalconfigThe settings page is about to open, while the old settings are still the saved ones.
OptionalconfigThe settings page closed and its new settings are saved.
OptionalmessageA message arrived from the watch. Each key the face declares can be read by its number, whichever way the phone keyed it.
OptionalpageChanges the settings page just before it opens, such as adding a choice only this phone can offer.
It runs every time the page opens, after configOpened. It gets its own copy of the face's page, or of the page the features before it handed back, and returns the page to open. It can change the copy it is given and hand that back. It keeps nothing from one open to the next, since each open starts again from the face's own page, which the defaults and the settings restore also read. A throw skips this hook alone, and the page opens with what the hooks before it made.
The settings page so far.
The settings page to open.
OptionalreadyPebbleKit JS is ready, and the settings request has gone out.
OptionalrefreshThe background refresh ticked. slow is true on the less frequent ticks, the ones meant for data that changes slowly, such as weather.
OptionalseededFixes up the settings the phone just took back from the watch, before they are saved.
It runs when the phone fills its saved settings from what the watch sends back, such as after the Pebble app is reinstalled. The seed copies each setting the face's own page has a row for. This hook can set one the page has no row for, or put back a value that no longer makes sense on this phone. It changes the settings it is given, and everything it sets is saved. A throw skips this hook alone, and the settings are still saved.
The settings about to be saved, by name. Change them in place.
Reads one setting, by name, as the raw value the watch sent back, or undefined when it sent none. Nothing is converted, so a select comes back as the number or the text it was sent as, and a toggle as 0 or 1. The plugin source fields are text, so a hook compares them as text.
OptionalsettingsChanges the settings a save or a restore sends the watch, after the phone has saved them.
It is for a value the watch has to hold that the feature decides in place of the page, such as the weather's units while a plugin serves them. It changes the dict it is given, keyed by message key number. A throw skips this hook alone, and the settings still go.
The settings about to go to the watch. Change them in place.
OptionalsettingsThe watch turned away every settings request since the last ready, so no settings reply comes until the next ready asks again.
The moments in the app's life a feature can act on. Every hook is optional.