TMS FNC WhatsApp Receiver — Guides
Handling message types
Inspect the MessageType field of TTMSFNCWhatsAppReceiverMessage to
branch on text, image, audio, video, document, contact, location, and sticker:
{ Branch on message type in OnWhatsAppMessageReceived: }
case AMessage.MessageType of
wrtText: { Handle AMessage.Text.Body }
Memo1.Lines.Add(AMessage.Text.Body);
wrtImage,
wrtAudio,
wrtVideo,
wrtDocument: { Handle AMessage.Media.ID, MimeType, etc. }
Memo1.Lines.Add('Media ID: ' + AMessage.Media.ID);
wrtLocation: { Handle AMessage.Location.Latitude/Longitude }
Memo1.Lines.Add('Lat: ' + FloatToStr(AMessage.Location.Latitude));
end;
Parsing contact cards
When a contact message arrives, iterate AMessage.Contacts to read names,
phone numbers, email addresses, and URLs from the structured
TTMSFNCWhatsAppReceiverContact objects.
Media handling
Media messages contain a Media object with ID, MimeType, and SHA256
fields. Use the WhatsApp Business API media endpoint with Media.ID to
download the actual file content.