In the Core Topics for Complications in section Subscribing to Complications:
- The text "To publish a complication" should say something like "To subscribe to a complication".
- The sample code uses the variable named complicationId for the iteration. This is misleading since the iterator actually iterates over complications not complication ids
- The sample also erroneously calls getComplication() with the result of the iterator, which is a complication, not an id. It should be getComplication(complication.complicationId)
- Likewise, the docs for getComplications erroneously says it iterates over ids which is incorrect.
While not an error exactly, it would be helpful to those learning how to use complications if the Core Topics section for Hold to Launch mentioned that the publisher can use AppBase.onStart() to determine which complication was used to launch it.
Then add a section before the Face It section that talks about using onStart() and show some sample code like:
function onStart(state) { if (state != null) { // get complication "id" as defined in <complication> definition XML var launchedFromComplication = state[:launchedFromComplication]; switch (launchedFromComplication) { case 0: ... case 1: ... ... } }