Closed BasselAshi closed 9 months ago
Problem
As described, running PairingCodeHandler generates a code that cannot be validated on the phone.
Observations
I noticed that using the verification code on Whatsapp Web will send a notification to my phone asking to pair and showing the validation code to be entered on Whatsapp Web. When using the library, I do not get this notification. Regardless, the verification code sent to the terminal cannot be validated on my phone.
My code looks like this (phone number redacted):
val connection = Whatsapp.webBuilder() .newConnection(1289*******) .name("WhatsAutomate") .unregistered(phoneNumber, PairingCodeHandler.toTerminal()) .addLoggedInListener{ x -> println("Hello :)" + x)} .connect() .join()
Does your phone number include the country prefix?
Does your phone number include the country prefix?
Yes. The prefix is just 1
being Canada.
I have got the same problem using the phone number with country prefix. No notification and the generated code is not accepted by the whatsapp app.
WebOptionsBuilder webOptionsBuilder = Whatsapp.webBuilder()
.newConnection("alias1")
.historyLength(WebHistoryLength.ZERO);
Whatsapp whatsapp = webOptionsBuilder
.registered()
.orElseGet(() -> webOptionsBuilder.unregistered(...L, PairingCodeHandler.toTerminal()))
.addLoggedInListener(api -> System.out.printf("Connected: %s%n", api.store().privacySettings()))
.addDisconnectedListener(reason -> System.out.printf("Disconnected: %s%n", reason))
.connect()
.join();
Same issue for me. Any news regarding the problem?
Same issue for me. Any news regarding the problem?
Will be fixed in cobalt 1.0
Fixed in 0.0.1
Problem
As described, running PairingCodeHandler generates a code that cannot be validated on the phone.
Observations
I noticed that using the verification code on Whatsapp Web will send a notification to my phone asking to pair and showing the validation code to be entered on Whatsapp Web. When using the library, I do not get this notification. Regardless, the verification code sent to the terminal cannot be validated on my phone.
My code looks like this (phone number redacted):