/** * apns/client.ts — Apple Push Notification service (APNs) client for AIBroker. * * Sends push notifications to PAILot devices when no MQTT clients are connected. * Device tokens are stored in ~/.aibroker/apns-tokens.json. * * Configuration (loaded from ~/.aibroker/env or process.env): * APNS_KEY_PATH — path to the .p8 auth key file * APNS_KEY_ID — 10-character key ID (e.g., C9Z39FRQ2N) * APNS_TEAM_ID — 10-character Apple Team ID (e.g., 7KU642K5ZL) * APNS_PRODUCTION — set to "1" or "true" to use production APNs host */ /** * Register a device token. Silently ignores duplicates. */ export declare function registerToken(token: string): void; /** * Remove a device token (e.g., on InvalidToken APNs error). */ export declare function removeToken(token: string): void; /** * Returns all registered device tokens. */ export declare function getTokens(): string[]; /** Reset badge counter — call when the app connects via MQTT. */ export declare function resetBadge(): void; export interface PushPayload { title: string; body: string; badge?: number; data?: Record; } /** * Send a push notification to a single device token. * Returns true on success, false on failure. */ export declare function sendPushToToken(token: string, payload: PushPayload): Promise; /** * Send a push notification to all registered device tokens. * Returns the number of tokens that succeeded. */ export declare function sendPush(title: string, body: string, data?: Record, badge?: number): Promise; /** * Send a SILENT background push that clears the iOS home-screen badge. * resetBadge() alone only resets the in-memory counter — iOS keeps displaying * whatever number the last push set until a new push tells it otherwise. A * SilentNotification with badge: 0 is delivered as a background push (no alert, * no sound) and just repaints the icon. Call on app-connect (WS/MQTT) — the app * being online means the user is reading, so any pending count is stale. */ export declare function sendBadgeClear(): Promise; //# sourceMappingURL=client.d.ts.map