The Advanced iMessage Kit SDK provides comprehensive message sending capabilities including basic text messages, replies, rich links, and visual effects.
Reply to specific messages using the selectedMessageGuid parameter to create threaded conversations.
// Send initial messageconst firstMessage = await sdk.messages.sendMessage({ chatGuid: "iMessage;-;+1234567890", message: "What's your favorite color?"});await new Promise(resolve => setTimeout(resolve, 1000));// Send a second messageconst secondMessage = await sdk.messages.sendMessage({ chatGuid: "iMessage;-;+1234567890", message: "Also, what's your favorite food?"});await new Promise(resolve => setTimeout(resolve, 2000));// Reply to the FIRST message specificallyconst reply = await sdk.messages.sendMessage({ chatGuid: "iMessage;-;+1234567890", message: "My favorite color is blue!", selectedMessageGuid: firstMessage.guid});console.log(`Replied to: ${firstMessage.guid}`);
Replies create a visual thread in iMessage that links the new message to the original.
Add subjects to messages (similar to email subject lines).
const messageWithSubject = await sdk.messages.sendMessage({ chatGuid: "iMessage;-;+1234567890", message: "The meeting has been moved to 3 PM tomorrow.", subject: "Meeting Time Change"});
The SDK automatically creates chats if they don’t exist when you send a message.
// This works even if you've never messaged this number beforeconst message = await sdk.messages.sendMessage({ chatGuid: "iMessage;-;+19876543210", message: "First message to a new contact!"});