Auties00 / Cobalt

Standalone unofficial fully-featured Whatsapp Web and Mobile API for Java and Kotlin
MIT License
625 stars 183 forks source link

QR authorization #253

Closed SachukS closed 1 year ago

SachukS commented 1 year ago

In new versions ability to override QrHandler have removed from code. How i can get it QR to send it to my front for example?

SachukS commented 1 year ago

Sorry, just recognized that i can define custom QrHandler through options builder

devPedroFreire commented 1 year ago

did you find out how to print image and after that call a method?

Auties00 commented 1 year ago

did you find out how to print image and after that call a method?

supply a custom qr handler

devPedroFreire commented 1 year ago

I would like to return my qrcode, but it returns only if I read it.

api = Whatsapp.webBuilder() .newConnection().name("InterWPP") .unregistered(QrHandler.toFile(temp.toPath(), QrHandler.ToFileConsumer.toTerminal())) api.connect().join()

Auties00 commented 1 year ago

I would like to return my qrcode, but it returns only if I read it.

api = Whatsapp.webBuilder() .newConnection().name("InterWPP") .unregistered(QrHandler.toFile(temp.toPath(), QrHandler.ToFileConsumer.toTerminal())) api.connect().join()

Don't return your qr code, move that login inside a custom qrHandler

devPedroFreire commented 1 year ago

maybe I'm bad at this, but I really couldn't do anything

Auties00 commented 1 year ago

maybe I'm bad at this, but I really couldn't do anything

I'm sorry, but everything is documented. I suggest reading the javadocs and readme. If you still can't figure it out, you might need to take some to be more comfortable with Java.

devPedroFreire commented 1 year ago

where can I put a qrHandler? Is it possible in the latest version? I'm using 3.5.1 and the only place I can pass a QrHandler is inside unregistered(), Can you give me a clue or tell what too look into to know how to do it?

Auties00 commented 1 year ago

where can I put a qrHandler? Is it possible in the latest version? I'm using 3.5.1 and the only place I can pass a QrHandler is inside unregistered(), Can you give me a clue or tell what too look into to know how to do it?

just pass your custom qr handler there

devPedroFreire commented 1 year ago

But it executes only after the join(), I woud like to get the file before the join and after that call another method, but it seems that i need something with the return but I really dont know where to look