Pebble App Framework: Phone API
    Preparing search index...

    Interface PluginPebble

    A plugin app script's Pebble.

    interface PluginPebble {
        permissions?: { query(permission: string): Promise<string> };
        secureStorage: SecureStorage;
        deleteTimelinePin?(id: string): unknown;
        insertTimelinePin?(pin: TimelinePin): unknown;
        readSource(request: SourceRequest): Promise<SourceEnvelope>;
        refreshSources(sources: string[]): void;
        registerActionHandler(
            handler: (
                request: ActionRequest,
                respond: ActionResponder,
            ) => void | Promise<void>,
        ): void;
        registerConfigHandler(
            handler: (
                message: unknown,
                respond: (reply: unknown) => void,
            ) => void | Promise<void>,
        ): void;
        registerSourceHandler(
            handler: (
                request: SourceRequest,
                respond: SourceResponder,
            ) => void | Promise<void>,
        ): void;
        showNotification?(notification: PluginNotification): unknown;
        subscribeSource(request: SourceRequest): void;
    }
    Index
    permissions?: { query(permission: string): Promise<string> }

    Asks whether one of the plugin's own permissions works right now, taking it as the appinfo declares it, such as Timeline or Internet/finnhub.io. It answers granted when using it will work, prompt when the wearer has to allow it first in the Pebble app, and denied when the wearer turned it off. It does not count as using the permission, and the answer can change without the wearer doing anything. Left out on a Pebble app too old to have it.

    secureStorage: SecureStorage
    • Hands the Pebble app a pin id to take off the timeline. An unknown id is dropped without a word. Left out as insertTimelinePin is.

      Parameters

      • id: string

      Returns unknown

    • Hands a pin to the Pebble app, to put on the timeline or to change the one with its id. It answers nothing and never rejects. A pin the plugin has no Timeline grant for, or one that does not parse, is dropped without a word, so a pin handed over is not a pin on the watch. It throws only when the pin cannot be turned into JSON. Left out on a Pebble app from before 1.18.0. insertPin in ts/plugin-app/timeline.ts calls it safely.

      Parameters

      Returns unknown

    • Parameters

      • handler: (message: unknown, respond: (reply: unknown) => void) => void | Promise<void>

      Returns void

    • Shows a notification on the watch, with a pin's layout and actions. Needs ShowNotifications, and answers nothing. Left out as insertTimelinePin is.

      Parameters

      Returns unknown