handles service on the BlueBubbles SDK client lets you count handles stored on the macOS device, query them in bulk, retrieve a single handle by address, and check whether an address supports iMessage, FaceTime, or is currently in a focus mode such as Do Not Disturb.
Access the service through client.handles.
Count handles
getHandleCount()
Returns the total number of handles stored in the iMessage database on the device.
Signature
Query handles
queryHandles()
Queries handles from the iMessage database with optional pagination, relation loading, and sorting.
Signature
Maximum number of handles to return. Useful for paging through large result
sets.
Number of handles to skip before returning results. Combine with
limit to
paginate through the database.Related data to include with each handle. Accepted values:
participants,
lastmessage, sms, archived.Sort order for results. Pass
lastmessage to sort by the most recent message.
Requires lastmessage to also be present in the with array.Get a handle by address
get()
Fetches a single handle’s database record by its address (phone number or email).
Signature
The iMessage address to look up. Can be a phone number (e.g.
+12125551234) or an email address (e.g. user@icloud.com).Check availability
getImessageAvailability()
Checks whether a given address has iMessage enabled.
Signature
The target address is resolved from the server context. Use this to verify
that an address can receive iMessages before attempting to send.
getFacetimeavailability()
Checks whether a given address has FaceTime enabled.
Signature
Check focus status
getHandleSFocusStatus()
Returns the current focus mode status for a handle. This tells you whether the recipient has Do Not Disturb or another focus mode active.
Signature
| Value | Meaning |
|---|---|
unknown | Focus status could not be determined |
silenced | The handle has an active focus mode (e.g., DND) |
none | No focus mode is active |