Skip to main content
Version: 3.0.0

📢 Replay a message

Send replay to a specific message

await whatsapp.replay(
phoneNumber: 'PHONE_NUMBER',
messageId: 'MESSAGE_ID',
replay: Replay().text("Thank for contacting us", true),
);
paramtyperequireddescription
phoneNumberStringyesPhone number with county code and plus.
messageIdStringyesA message id
replayMap<String, dynamic>yesReplay Content

Replay

For replay to a specific message, you can use Replay class methods, our you can use custom json object.

Here is predefined methods for Replay:

Text
Replay().text(
"Thank for contacting us", //Replay Text
true, //Url preview
);
Image
Replay().imageById(
"1100XXXXXXXXXXXXX", //Image Media ID
);
Audio
Replay().audioById(
"1100XXXXXXXXXXXXX", //Audio Media ID
);
Video
Replay().videoById(
"1100XXXXXXXXXXXXX", //Video Media ID
);
Document
Replay().documentById(
"1100XXXXXXXXXXXXX", //Document Media ID
);
Custom Object

You can pass your custom object as well. Find documentation here https://developers.facebook.com/docs/whatsapp/cloud-api/guides/send-messages/#replies

await whatsapp.replay(
phoneNumber: 'PHONE_NUMBER',
messageId: 'MESSAGE_ID',
replay: {
"type":"image",
"image" : {
"link" :"https://example.com/sample.jpg"
}
},
);