PebbleOS
Loading...
Searching...
No Matches
Functions

Builds timeline items from ANCS notifications. More...

Functions

TimelineItem * ancs_item_create_and_populate (ANCSAttribute *notif_attributes[], ANCSAttribute *app_attributes[], const ANCSAppMetadata *app_metadata, iOSNotifPrefs *notif_prefs, time_t timestamp, ANCSProperty properties)
 Create a timeline item from ANCS data.
 
void ancs_item_update_dismiss_action (TimelineItem *item, uint32_t uid, const ANCSAttribute *attr_action_neg)
 Replace the dismiss action of an item with an ANCS negative action.
 

Detailed Description

Builds timeline items from ANCS notifications.

Function Documentation

◆ ancs_item_create_and_populate()

TimelineItem * ancs_item_create_and_populate ( ANCSAttribute *  notif_attributes[],
ANCSAttribute *  app_attributes[],
const ANCSAppMetadata *  app_metadata,
iOSNotifPrefs *  notif_prefs,
time_t  timestamp,
ANCSProperty  properties 
)

Create a timeline item from ANCS data.

Strings that reach the ANCS length limit are ellipsized. Actions are, in order, the ANCS positive and negative actions followed by the actions from notif_prefs.

Parameters
notif_attributesNotification attributes, indexed by FetchedNotifAttributeIndex.
app_attributesApp attributes (the display name), indexed by FetchedAppAttributeIndex.
app_metadataIcon and color of the app.
notif_prefsiOS notification prefs of the app, may be NULL.
timestampTime the notification occurred.
propertiesANCS properties (category, flags).
Returns
New item allocated on the calling task's heap (free with timeline_item_destroy()), or NULL if out of memory. Header fields other than the timestamp are left for the caller.

◆ ancs_item_update_dismiss_action()

void ancs_item_update_dismiss_action ( TimelineItem *  item,
uint32_t  uid,
const ANCSAttribute *  attr_action_neg 
)

Replace the dismiss action of an item with an ANCS negative action.

The item's buffer is reallocated; pointers into the old one become invalid.

Parameters
[in,out]itemItem to update. Nothing happens if it has no dismiss action.
uidANCS UID of the notification whose negative action is used.
attr_action_negNegative action label from that notification.