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

How can I retrieve the session after connecting to WhatsApp? #67

Open
AhmedBahgat010 opened this issue Oct 24, 2024 · 1 comment
Open

Comments

@AhmedBahgat010
Copy link

I'm using your Flutter package, whatsapp_bot_flutter, and I have a question. After connecting to WhatsApp, how can I retrieve the session? Could you please guide me on how to get the session after the connection is established?

@chitoadinugraha
Copy link

chitoadinugraha commented Dec 10, 2024

If you mean sessionDirectory to preserve login data, you can set sessionDirectory

    final whatsappClient = await WhatsappBotFlutter.connect(
      onConnectionEvent: (ConnectionEvent event) {
        print(event.toString());
      },
      onQrCode: (String qr, Uint8List? imageBytes) {
        print('qr code $qr');
        print(AsciiQrGenerator.generate(qr));
      },
      sessionDirectory: '.session',
    );

if it is stuck on waitingForLogin, in my case the puppeteer doesnt close automatically on debug stop, so I need to manually kill the chrome process

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