PebbleOS
Loading...
Searching...
No Matches
Data Structures | Macros | Functions

App identification and timestamp parsing for ANCS notifications. More...

Data Structures

Macros

#define IOS_PHONE_APP_ID   "com.apple.mobilephone"
 Bundle identifier of the iOS Phone app.
 
#define IOS_CALENDAR_APP_ID   "com.apple.mobilecal"
 Bundle identifier of the iOS Calendar app.
 
#define IOS_REMINDERS_APP_ID   "com.apple.reminders"
 Bundle identifier of the iOS Reminders app.
 
#define IOS_MAIL_APP_ID   "com.apple.mobilemail"
 Bundle identifier of the iOS Mail app.
 
#define IOS_SMS_APP_ID   "com.apple.MobileSMS"
 Bundle identifier of the iOS Messages app.
 
#define IOS_FACETIME_APP_ID   "com.apple.facetime"
 Bundle identifier of the iOS FaceTime app.
 

Functions

const ANCSAppMetadata * ancs_notifications_util_get_app_metadata (const ANCSAttribute *app_id)
 Look up the presentation of an app.
 
time_t ancs_notifications_util_parse_timestamp (const ANCSAttribute *timestamp_attr)
 Parse an ANCS date attribute.
 
bool ancs_notifications_util_is_phone (const ANCSAttribute *app_id)
 Check whether an app identifier is the iOS Phone app.
 
bool ancs_notifications_util_is_sms (const ANCSAttribute *app_id)
 Check whether an app identifier is the iOS Messages app.
 
bool ancs_notifications_util_is_group_sms (const ANCSAttribute *app_id, const ANCSAttribute *subtitle)
 Check whether a notification is a group message.
 

Detailed Description

App identification and timestamp parsing for ANCS notifications.


Data Structure Documentation

◆ ANCSAppMetadata

struct ANCSAppMetadata

Presentation of a known iOS app.

Data Fields
const char * app_id Bundle identifier, NULL for the generic entry used for unknown apps.
uint32_t icon_id Timeline resource id of the app icon.
bool is_blocked: 1 Whether the app's notifications should always be ignored.
bool is_unblockable: 1 Whether the app's notifications should never be ignored.

Macro Definition Documentation

◆ IOS_CALENDAR_APP_ID

#define IOS_CALENDAR_APP_ID   "com.apple.mobilecal"

Bundle identifier of the iOS Calendar app.

◆ IOS_FACETIME_APP_ID

#define IOS_FACETIME_APP_ID   "com.apple.facetime"

Bundle identifier of the iOS FaceTime app.

◆ IOS_MAIL_APP_ID

#define IOS_MAIL_APP_ID   "com.apple.mobilemail"

Bundle identifier of the iOS Mail app.

◆ IOS_PHONE_APP_ID

#define IOS_PHONE_APP_ID   "com.apple.mobilephone"

Bundle identifier of the iOS Phone app.

◆ IOS_REMINDERS_APP_ID

#define IOS_REMINDERS_APP_ID   "com.apple.reminders"

Bundle identifier of the iOS Reminders app.

◆ IOS_SMS_APP_ID

#define IOS_SMS_APP_ID   "com.apple.MobileSMS"

Bundle identifier of the iOS Messages app.

Function Documentation

◆ ancs_notifications_util_get_app_metadata()

const ANCSAppMetadata * ancs_notifications_util_get_app_metadata ( const ANCSAttribute *  app_id)

Look up the presentation of an app.

Parameters
app_idApp identifier attribute.
Returns
Metadata of a known app, or a generic entry (NULL app_id, generic icon) otherwise.

◆ ancs_notifications_util_is_group_sms()

bool ancs_notifications_util_is_group_sms ( const ANCSAttribute *  app_id,
const ANCSAttribute *  subtitle 
)

Check whether a notification is a group message.

Parameters
app_idApp identifier attribute.
subtitleSubtitle attribute; group messages from the Messages app have one.
Returns
true for a Messages notification with a non-empty subtitle.

◆ ancs_notifications_util_is_phone()

bool ancs_notifications_util_is_phone ( const ANCSAttribute *  app_id)

Check whether an app identifier is the iOS Phone app.

Parameters
app_idApp identifier attribute, may be NULL.
Returns
true if it is the Phone app.

◆ ancs_notifications_util_is_sms()

bool ancs_notifications_util_is_sms ( const ANCSAttribute *  app_id)

Check whether an app identifier is the iOS Messages app.

Parameters
app_idApp identifier attribute, may be NULL.
Returns
true if it is the Messages app.

◆ ancs_notifications_util_parse_timestamp()

time_t ancs_notifications_util_parse_timestamp ( const ANCSAttribute *  timestamp_attr)

Parse an ANCS date attribute.

The date is yyyyMMdd'T'HHmmSS in the phone's local time, which is assumed to match the watch's timezone.

Parameters
timestamp_attrDate attribute.
Returns
UTC timestamp, or 0 if the attribute is malformed.