session.phone to receive phone notifications and calendar events from the user’s companion app. It exposes two sub-managers: session.phone.notifications and session.phone.calendar.
Quick Example
Notifications
Listening for notifications
Subscribe to incoming phone notifications withsession.phone.notifications.on(). The handler fires each time a new notification arrives on the user’s phone.
| Field | Type | Description |
|---|---|---|
app | string | Name of the app that sent the notification |
title | string | Notification title |
content | string | Notification body text |
Listening for dismissed notifications
Subscribe to notifications the user dismisses on their phone:Permission check
Reading notifications requires the READ_NOTIFICATIONS permission. You can check at runtime:Calendar
Listening for calendar events
Subscribe to calendar events from the user’s phone:Permission check
Calendar events require the CALENDAR permission:API Reference
phone.notifications
| Member | Type | Description |
|---|---|---|
on(handler) | (handler: (data) => void) => () => void | Subscribe to incoming notifications. Returns a cleanup function. |
onDismissed(handler) | (handler: (data) => void) => () => void | Subscribe to dismissed notifications. Returns a cleanup function. |
hasPermission | boolean | Whether the app has READ_NOTIFICATIONS permission. |
phone.calendar
| Member | Type | Description |
|---|---|---|
on(handler) | (handler: (data) => void) => () => void | Subscribe to calendar events. Returns a cleanup function. |
hasPermission | boolean | Whether the app has CALENDAR permission. |
Common Patterns
Filter notifications by app
Show upcoming calendar events on session start
Combine notifications and transcription
Guard both permissions at once
Permissions
Your app must declare the appropriate permissions in the Developer Console:| Feature | Required Permission |
|---|---|
phone.notifications.on() | READ_NOTIFICATIONS |
phone.notifications.onDismissed() | READ_NOTIFICATIONS |
phone.calendar.on() | CALENDAR |
hasPermission returns false and event handlers will not fire. See Permissions for details on declaring and managing permissions.
