PebbleOS v4.47.0-512-g5285d4236
Loading...
Searching...
No Matches
ANCS notifications

Turns notifications received over the Apple Notification Center Service into items. More...

Modules

 ANCS filtering
 Per-app mute schedules and filtering rules for ANCS notifications.
 
 ANCS items
 Builds timeline items from ANCS notifications.
 
 ANCS utilities
 App identification and timestamp parsing for ANCS notifications.
 
 ANCS phone calls
 Phone call events derived from ANCS notifications.
 
 Nexmo reauthentication
 Handles the SMS check-in code used to reauthenticate SMS replies.
 

Enumerations

enum  ancs_notif_attr {
  ANCS_NOTIF_ATTR_POSITIVE_ACTION_LABEL , ANCS_NOTIF_ATTR_NEGATIVE_ACTION_LABEL , ANCS_NOTIF_ATTR_APP_ID , ANCS_NOTIF_ATTR_TITLE ,
  ANCS_NOTIF_ATTR_SUBTITLE , ANCS_NOTIF_ATTR_MESSAGE , ANCS_NOTIF_ATTR_DATE , ANCS_NOTIF_ATTR_COUNT
}
 The attributes got of a notification, in the order they are asked for. More...
 
enum  ancs_app_attr { ANCS_APP_ATTR_DISPLAY_NAME , ANCS_APP_ATTR_COUNT }
 The attributes got of the app of a notification. More...
 

Functions

void ancs_notifications_handle_message (const struct pbl_bt_ancs_notif *notif, bool recovered, const struct pbl_bt_ancs_attr *const *notif_attributes, const struct pbl_bt_ancs_attr *const *app_attributes)
 Handle a notification fetched from ANCS.
 
void ancs_notifications_handle_notification_removed (const struct pbl_bt_ancs_notif *notif)
 Handle the removal of a notification from the iOS notification center.
 
void ancs_notifications_handle_access_denied (void)
 Tell the user that iOS refuses to share notifications with this watch.
 
void ancs_notifications_handle_session_lost (void)
 Record that the ANCS session went away.
 

Longest values taken

The phone cuts the title, the subtitle and the message to theirs.

#define ANCS_APP_ID_MAX_LENGTH   60
 
#define ANCS_TITLE_MAX_LENGTH   128
 
#define ANCS_SUBTITLE_MAX_LENGTH   40
 
#define ANCS_MESSAGE_MAX_LENGTH   200
 
#define ANCS_DATE_LENGTH   15
 
#define ANCS_ACTION_MAX_LENGTH   10
 

Detailed Description

Turns notifications received over the Apple Notification Center Service into items.

The ANCS client hands over the fetched notification and app attributes. Each app seen is recorded in the iOS notification preferences database, which the phone syncs to add actions, colors, mute schedules and filtering rules. Muted and filtered notifications are dropped, incoming calls go to the phone service, duplicates are ignored, and the rest are stored as notifications (see Notifications).

Macro Definition Documentation

◆ ANCS_ACTION_MAX_LENGTH

#define ANCS_ACTION_MAX_LENGTH   10

◆ ANCS_APP_ID_MAX_LENGTH

#define ANCS_APP_ID_MAX_LENGTH   60

◆ ANCS_DATE_LENGTH

#define ANCS_DATE_LENGTH   15

◆ ANCS_MESSAGE_MAX_LENGTH

#define ANCS_MESSAGE_MAX_LENGTH   200

◆ ANCS_SUBTITLE_MAX_LENGTH

#define ANCS_SUBTITLE_MAX_LENGTH   40

◆ ANCS_TITLE_MAX_LENGTH

#define ANCS_TITLE_MAX_LENGTH   128

Enumeration Type Documentation

◆ ancs_app_attr

The attributes got of the app of a notification.

Enumerator
ANCS_APP_ATTR_DISPLAY_NAME 
ANCS_APP_ATTR_COUNT 

◆ ancs_notif_attr

The attributes got of a notification, in the order they are asked for.

Enumerator
ANCS_NOTIF_ATTR_POSITIVE_ACTION_LABEL 
ANCS_NOTIF_ATTR_NEGATIVE_ACTION_LABEL 
ANCS_NOTIF_ATTR_APP_ID 
ANCS_NOTIF_ATTR_TITLE 
ANCS_NOTIF_ATTR_SUBTITLE 
ANCS_NOTIF_ATTR_MESSAGE 
ANCS_NOTIF_ATTR_DATE 
ANCS_NOTIF_ATTR_COUNT 

Function Documentation

◆ ancs_notifications_handle_access_denied()

void ancs_notifications_handle_access_denied ( void  )

Tell the user that iOS refuses to share notifications with this watch.

Called when iOS keeps rejecting Control Point writes. Posts a notification explaining how to turn on notification sharing.

◆ ancs_notifications_handle_message()

void ancs_notifications_handle_message ( const struct pbl_bt_ancs_notif *  notif,
bool  recovered,
const struct pbl_bt_ancs_attr *const *  notif_attributes,
const struct pbl_bt_ancs_attr *const *  app_attributes 
)

Handle a notification fetched from ANCS.

Parameters
notifThe notification, as the phone told of it.
recoveredWhether it predates the session, seen right after reconnecting: it may have been missed while disconnected.
notif_attributesNotification attributes, indexed by enum ancs_notif_attr.
app_attributesApp attributes, indexed by enum ancs_app_attr.

◆ ancs_notifications_handle_notification_removed()

void ancs_notifications_handle_notification_removed ( const struct pbl_bt_ancs_notif *  notif)

Handle the removal of a notification from the iOS notification center.

The stored notification is marked dismissed, and an incoming call UI is hidden.

Parameters
notifThe removed notification, as the phone told of it.

◆ ancs_notifications_handle_session_lost()

void ancs_notifications_handle_session_lost ( void  )

Record that the ANCS session went away.

Notifications posted after this point are recovered when iOS re-sends them as pre-existing on reconnection.