Overview
Learn how to initialize the Advanced iMessage Kit SDK and perform basic operations like sending messages and listening for incoming messages.Sending a Message
The simplest way to send a message is to initialize the SDK, wait for the ready event, and use thesendMessage method.
Key Points
- Initialize the SDK with
createSDK() - Wait for the
readyevent before performing operations - Use
chatGuidto specify which conversation to send to - The returned message object contains metadata like
guidanddateCreated - Always close the SDK connection when done
Listening for Messages
To build a message listener that handles incoming messages in real-time:Event Handlers
new-message
new-message
Fired when a new message is received. The message object contains:
handle.address- Sender’s phone number or emailtext- Message text contentisFromMe- Boolean indicating if you sent the message
updated-message
updated-message
Fired when a message status changes (delivered, read, etc.):
dateRead- Timestamp when message was readdateDelivered- Timestamp when message was delivereddateSent- Timestamp when message was sent
error
error
Handles SDK errors. Always implement this handler for production apps.
Getting Chat GUIDs
To find a chat GUID for sending messages, you can list all your chats:Next Steps
Auto-Reply Bot
Build an automated responder
Message Effects
Add visual effects to messages
Reactions
Send tapbacks and reactions
Group Chats
Manage group conversations