@photon-ai/advanced-imessage-kit is the legacy HTTP + Socket.IO-based iMessage SDK. For new projects, use @photon-ai/advanced-imessage instead.
Installation
Quick start
SDK options
chatGuid format
chatGuid is the unique identifier for a conversation, in the format service;separator;address:
| Type | Format | Example |
|---|---|---|
| iMessage DM | iMessage;-;address | iMessage;-;+1234567890 |
| SMS DM | SMS;-;address | SMS;-;+1234567890 |
| Group chat | iMessage;+;identifier | iMessage;+;chat123456789 |
| Auto-detect | any;-;address | any;-;+1234567890 |
any;-; when you want the SDK to automatically pick iMessage or SMS based on availability.
Connection events
Closing the client
Messages
sdk.messages covers sending, reacting, editing, unsending, querying, and real-time message events.
Sending
Message effects
| Effect | effectId |
|---|---|
| Confetti | com.apple.messages.effect.CKConfettiEffect |
| Fireworks | com.apple.messages.effect.CKFireworksEffect |
| Balloons | com.apple.messages.effect.CKBalloonEffect |
| Hearts | com.apple.messages.effect.CKHeartEffect |
| Lasers | com.apple.messages.effect.CKHappyBirthdayEffect |
| Shooting Star | com.apple.messages.effect.CKShootingStarEffect |
| Sparkles | com.apple.messages.effect.CKSparklesEffect |
| Echo | com.apple.messages.effect.CKEchoEffect |
| Spotlight | com.apple.messages.effect.CKSpotlightEffect |
| Gentle | com.apple.MobileSMS.expressivesend.gentle |
| Loud | com.apple.MobileSMS.expressivesend.loud |
| Slam | com.apple.MobileSMS.expressivesend.impact |
| Invisible Ink | com.apple.MobileSMS.expressivesend.invisibleink |
Text styles & animations
Text styles and animations are not supported by the legacy SDK. Use
@photon-ai/advanced-imessage for rich
text formatting and message effects.Reactions
Edit & unsend
Querying
Real-time events
Chats
sdk.chats handles listing conversations, managing group chats, typing indicators, and chat backgrounds.
Get chats
Create chat
Group chats
Chat status & typing
Chat background
Real-time events
Attachments
sdk.attachments handles sending and downloading files, images, audio messages, and stickers.
Send attachment
Send stickers
Download attachments
Scheduled Messages
sdk.scheduledMessages lets you schedule messages to send once or on a recurring interval.
Error Handling
The legacy SDK uses HTTP responses under the hood. Errors surface as thrown exceptions with an optionalresponse property.