Send rich iMessage content to your users with automatic fallback to SMS when iMessage is not available.
iMessage messages require the recipient to have an Apple device with iMessage enabled. If iMessage is not available, you can configure automatic fallback to SMS.
Copy
const res = await contiguity.imessage.send({ to: "+1234567890", message: "Hello via iMessage!", // from: "+15555555555", fallback: { when: ["imessage_unsupported", "imessage_fails"], from: "+15555555555" }, attachments: ["https://example.com/image.png"]});
You can also send a simple iMessage without attachments:
Copy
const res = await contiguity.imessage.send({ to: "+1234567890", message: "Hello from your app!"});