im.locations sends Find My location-sharing requests and reads friend locations that are already visible to the current iMessage account.
Use request(chat, address) when you want to ask someone to share location. Use list(...), get(...), and watch(...) after location is already shared with the current account.
What You Can Do
| Need | Use this when |
|---|---|
| Request location sharing | You want to send a visible Find My request card to a chat participant |
| List shared locations | You want every currently visible friend location |
| Fetch one location | You want the latest snapshot for one friend |
| Watch live updates | You are updating a map or background job as locations change |
Before You Use It
| Rule | Meaning |
|---|---|
| Requests do not grant access | request(...) only sends a visible request card; the other person must accept or start sharing |
| Reads only show visible shares | list(...), get(...), and watch(...) only return locations already visible to the current account |
| Coordinates can be absent | Check both latitude and longitude before plotting a point |
| Missed updates are gone | watch(...) updates missed during a disconnect are not replayed by catchUp(...) |
Request Location Sharing
Send a visible Find My request card in an existing direct or group chat:| Argument | Meaning |
|---|---|
chat | Where to send the request card. Pass a direct or group chat.guid, not an email or phone number. |
address | Who to ask for location. Pass that person’s full email address or E.164 phone number. |
options.clientMessageId | Optional idempotency key for retrying the same logical request. |
address must belong to someone in chat. In a direct chat, that means the other participant. In a group chat, that means an existing group member.
Returns LocationRequestReceipt. A successful call means the request card was sent or the server accepted the request operation. It does not mean the other person is now sharing location.
The returned receipt includes:
| Field | Meaning |
|---|---|
address | The normalized email address or E.164 phone number that was requested |
status | Server status for the request operation |
reason | Optional reason when the request was not sent or needs explanation |
messageGuid | Message GUID for the request card, when a card was created |
messageGuid is present, use it like any other message GUID. For example, you can look it up with im.messages.get(...).
For idempotent retries from your job system, pass clientMessageId:
clientMessageId is only needed when your queue or worker may rerun the same logical request after a crash or timeout. Most direct calls can omit it. See error handling for details.get(...), list(...), or watch(...) to read their location.
List Shared Locations
list(...) takes no arguments.
Returns SharedFriendLocation[]. If no friends are sharing location, the array is empty. Each item is a location snapshot, and a snapshot is not guaranteed to include coordinates.
latitude and longitude are optional. They may be absent while a device is still locating, when location is unavailable, or when only address metadata is available.
Get One Friend Location
| Argument | Meaning |
|---|---|
address | The friend whose location you want. Pass a full email address or E.164 phone number. Do not pass chat.guid or a display name. |
+, and omit spaces, parentheses, and dashes.
Returns SharedFriendLocation. If the address is not sharing location or is not visible to the current account, get(...) throws NotFoundError.
The returned object looks like this:
Location Types
location.locationType describes how fresh the snapshot is:
| Value | Meaning |
|---|---|
"live" | Actively updating live location |
"shallow" | Recent cached location |
"legacy" | Older cached location from a previous session |
"unknown" | The server could not classify the source |
locationType only describes freshness. It does not guarantee that coordinates are present.
Watch Live Updates
Scope
Watch every visible friend’s location updates:| Call | Meaning |
|---|---|
watch() | Watch every visible friend’s location updates |
watch(address) | Watch one friend by full email address or E.164 phone number |
chat.guid or a display name to watch(...).
Update Shape
Each update isSharedFriendLocationUpdated:
for await loop closes the live stream.