You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs-src/spectrum-ts/providers/imessage.mdx.vel
+54Lines changed: 54 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -258,6 +258,60 @@ Background UI may not appear in these cases:
258
258
The string `"clear"` is a reserved sentinel. If you have a file literally named `clear` with no extension, pass `"./clear"` or load it as a `Buffer`.
259
259
</Note>
260
260
261
+
## Mini-app cards
262
+
263
+
Send a customized iMessage mini-app card — a remote-only rich bubble that shows app metadata, a deep link, and a visual layout. Import `customizedMiniApp` from the iMessage provider:
264
+
265
+
```ts
266
+
import { customizedMiniApp } from "spectrum-ts/providers/imessage";
267
+
268
+
const sent = await space.send(customizedMiniApp({
269
+
appName: "My App",
270
+
extensionBundleId: "com.example.myapp.imessage",
271
+
teamId: "ABCDE12345",
272
+
url: "https://example.com/deep-link",
273
+
layout: {
274
+
caption: "Check this out",
275
+
subcaption: "Tap to open",
276
+
},
277
+
}));
278
+
```
279
+
280
+
`space.send(customizedMiniApp(...))` returns the sent message record — unlike `background` and `read`, mini-app cards are real outbound messages.
281
+
282
+
`appStoreId` is optional. Omit it to send a card whose extension isn't published on the App Store; when set, recipients without the extension are directed to its App Store entry.
283
+
284
+
<AccordionGroup>
285
+
<Accordion title="CustomizedMiniAppInput" description="Fields for building a mini-app card.">
286
+
| Field | Type | Description |
287
+
|---|---|---|
288
+
| `appName` | `string` | Display name of the owning app, shown by Messages fallback UI. |
289
+
| `appStoreId` | `number` (optional) | Apple App Store numeric ID. Omit for unpublished extensions. |
290
+
| `extensionBundleId` | `string` | Bundle identifier of the iMessage extension target. |
| `image` | `Uint8Array` (optional) | Image data for the card. Must be set with `imageTitle`. |
303
+
| `imageTitle` | `string` (optional) | Title for the image. Must be set with `image`. |
304
+
| `imageSubtitle` | `string` (optional) | Subtitle for the image. Requires `image`. |
305
+
| `summary` | `string` (optional) | Fallback text for surfaces that can't render the card (notifications, lock screen). |
306
+
307
+
At least one of `caption`, `subcaption`, `trailingCaption`, `trailingSubcaption`, or `image` must be set.
308
+
</Accordion>
309
+
</AccordionGroup>
310
+
311
+
<Note>
312
+
Mini-app cards require cloud or dedicated mode. In local mode, `customizedMiniApp()` throws an `UnsupportedError`.
313
+
</Note>
314
+
261
315
## Fetching attachments
262
316
263
317
Retrieve an attachment by its iMessage GUID using `getAttachment` on the narrowed platform instance. The returned `Attachment` is lazy — `.read()` and `.stream()` each trigger an independent download, so cache `.read()` if you need the bytes more than once.
0 commit comments