Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: TWPPConnect.IsConnected always return False #65

Closed
kayaliabd opened this issue Dec 17, 2023 · 1 comment
Closed

Bug: TWPPConnect.IsConnected always return False #65

kayaliabd opened this issue Dec 17, 2023 · 1 comment

Comments

@kayaliabd
Copy link

IsConnected property is always return false even if component connected to WhatsApp

@marcelo386
Copy link
Collaborator

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;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants