Manual ACK
By default, the SDK sends a PROCESSED ack immediately after decrypting each message. Set autoAckIncomingMessages: false to defer the ack until the user has seen the message.
const client = await initialize({
...,
autoAckIncomingMessages: false,
});
client.onMessage(async (msg) => {
// Store message; defer ack
await db.saveMessage(msg);
});
// Later, when the message appears in view:
await client.ack(msg.messageId);
// Sender receives a PROCESSED delivery eventack(messageId)
- Parameter:
messageId, string, the ID from the received message - Returns:
Promise<void>(JS) /Unit(Android) /async throws(iOS) - Effect: Fires a PROCESSED event to the sender