Closed kayaliabd closed 5 months ago
use the same as the code below
if not frDemo.TWPPConnect1.auth then exit;
frDemo.TWPPConnect1.IsOnline;
will return in the component event like this example that is available in the demo version
procedure TfrDemo.TWPPConnect1GetIsOnline(Response: TIsOnline); begin if Response.IsOnline then begin frameMensagensRecebidas1.memo_unReadMessage.Lines.Add('Online');
frameLogin1.lblStatus.Caption := 'Online';
frameLogin1.lblStatus.Font.Color := $0000AE11;
frameLogin1.SpeedButton3.Enabled := True;
frameLogin1.whatsOn.Visible := True;
frameLogin1.whatsOff.Visible := False;
StatusBar1.Panels[1].Text := 'Online';
frameLogin1.imgQrCode.Picture := nil;
end else begin frameMensagensRecebidas1.memo_unReadMessage.Lines.Add('Offline');
frameLogin1.lblStatus.Caption := 'Offline';
frameLogin1.lblStatus.Font.Color := $002894FF;
frameLogin1.lblStatus.Font.Color := clGrayText;
frameLogin1.whatsOff.Visible := True;
frameLogin1.whatsOn.Visible := False;
frameLogin1.SpeedButton3.Enabled := True;
StatusBar1.Panels[1].Text := 'Offline';
end; end;
IsConnected property is always return false even if component connected to WhatsApp