Skip to main content
Table of Contents

TMS FNC WhatsApp Receiver

TTMSFNCWhatsAppReceiver is a headless component that receives the messages sent to a WhatsApp Business number. It connects securely to a TTMSFNCWhatsAppServer, which hosts the WhatsApp webhook, and parses each forwarded message — text, images, documents, audio, video, stickers, locations, and contacts — into structured Delphi objects. It is built on TTMSFNCWebsocketClient and is the one component of this product that also runs in TMS WEB Core browser applications.

Documentation

Start here Use when
Get started Connect to a WhatsApp server and handle your first message.
Guides Task guides: the event pipeline, message types, contacts, and safe handling.
API reference Full property, method, and event reference.

Supported frameworks

Framework Support
VCL Win32 and Win64.
FMX Windows, macOS, iOS, Android, and Linux.
TMS WEB Core Chrome, Edge, Firefox, Safari, and other modern browsers, through WEBLib.TMSFNCWhatsAppReceiver.

Minimal example

Connect to the server and show every incoming message:

Connect and handle incoming messagesPascal
procedure TForm1.FormCreate(Sender: TObject);
begin
  // wss://hooks.example.com:443/  - the host running TTMSFNCWhatsAppServer
  TMSFNCWhatsAppReceiver1.HostName := 'hooks.example.com';
  TMSFNCWhatsAppReceiver1.Port := 443;
  TMSFNCWhatsAppReceiver1.Active := True;
end;

procedure TForm1.TMSFNCWhatsAppReceiver1WhatsAppMessageReceived(Sender: TObject;
  AMessage: TTMSFNCWhatsAppReceiverMessage);
var
  Line: string;
begin
  // Read what you need now: AMessage is freed when the handler returns.
  Line := AMessage.From.Name + ' (' + AMessage.From.Phone + '): ' + AMessage.Text.Body;

  // In VCL and FMX applications this event runs on a background thread.
  TThread.Queue(nil,
    procedure
    begin
      Memo1.Lines.Add(Line);
    end);
end;

API map

Role Classes
Main component TTMSFNCWhatsAppReceiver, derived from TTMSFNCWebsocketClient in VCL and FMX
Message TTMSFNCWhatsAppReceiverMessage, TTMSFNCWhatsAppReceiverMessageFrom, TTMSFNCCustomWhatsAppMessageReceivedEvent
Content TTMSFNCWhatsAppReceiverText, TTMSFNCWhatsAppReceiverMedia, TTMSFNCWhatsAppReceiverLocation
Contact cards TTMSFNCWhatsAppReceiverContact, TTMSFNCWhatsAppReceiverContactName, TTMSFNCWhatsAppReceiverContactOrganization, TTMSFNCWhatsAppReceiverContactPhone, TTMSFNCWhatsAppReceiverContactEmail, TTMSFNCWhatsAppReceiverContactAddress, TTMSFNCWhatsAppReceiverContactURL
Collections TTMSFNCWhatsAppReceiverContacts, TTMSFNCWhatsAppReceiverContactPhones, TTMSFNCWhatsAppReceiverContactEmails, TTMSFNCWhatsAppReceiverContactAddresses, TTMSFNCWhatsAppReceiverContactURLs
Enumerations TTMSFNCWhatsAppReceiverContactType, TTMSFNCWhatsAppReceiverContactPhoneType

Guides

Area Guide
Receiving Receiving messages — connecting, the event pipeline, message types, contacts, thread-safe handling, and browser differences.

See Also