-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
feat: add new link with phone option #2363
Conversation
c504d6f
to
b8f1488
Compare
The things that matter to me are.
|
Thanks you ! |
cc @tofers |
Required to be reproduced as in the original WA.
These are the basic actions in the original Whatsapp. Restarting the puppeteer to switch methods is not the best way. |
@tofers Why would you like to switch methods in runtime? Just choose QR or Code, and then it will proceed with the selected mode. |
without regen observer
6693f3b
to
703c8c8
Compare
just tested the phone code linking method and works great lgtm |
Good work! |
haven't been able to get the login code after being linked? |
@renzhxr I'm not sure if I got your issue. Could you describe it better? If I got your question correctly, the answer is: you won't get any code after linking. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested good job
then how to do client.logout from this method? |
I thought it was because of this: npm i https://github.com/pedroslopez/whatsapp-web.js#main |
@pfnh26 I've made a temporary modifications in my fork, that fixes the selector for me while waiting for this feature to be completed by this repository. Can I ask you to try and see if it works for you? |
This change worked, but is it temporary? Thank you very much, my project really appreciates it |
Happy to have it working for you! It is temporary because WhatsApp Web can make changes on the UI, thus we'll have to update the code again. I'll keep maintaining my fork tho, cause one of my project is using it until whatsapp-web.js have the feature to link by phone. |
Thanks again, but I'm hoping that whatsapp-web.js has this feature natively, we agree that QRcode authentication is very outdated |
Any updates? will this pull request merged? |
good afternoon my friend, how are you? |
Thanks for the notice, I'll check the problem and try to fix it later this day. You can modify if you have some knowledge on JavaScript, there a lots of tutorial in the internet. The file to be modified is the |
OK, I'll study this, I believe I can help you next time. |
Okay, so I've looked into it. It's an ongoing problem with WhatsApp Web version 2.3XXX. The workaround is to add the
Be sure to update your whatsapp-web.js package with |
Sorry for not telling you how to resolve the webVersionCache error, below is the solution: It's the same thing you did, but including it this way you don't need to write it inside the client code. |
Thank you for this, I'll make this change soon! |
Did you manage to resolve the "LinkingMethod" error? |
Yes, you can use it normally now. Just run |
The code is not being generated, could I be doing something wrong? |
Try to delete your session folder, or maybe reinstall my repo:
|
I did this, but the code is not generated, it does not give an error, but it also does not generate the code. const { Client, LinkingMethod, LocalAuth} = require('whatsapp-web.js'); |
I don't think so, I've tried exactly your code and I'm able to receive the code from WhatsApp. Maybe try new number? Just in case, I've changed the WhatsApp version in my repo. You can try to reinstall again. |
Sorry for the delay in testing, but it still doesn't work for me, the format I used before was like this <+556292286543> |
I've tried that number, I still can get the code... very strange. Let's not spam our conversations here, create an issue here. |
here it is : |
@MobCode100 all good? Error: Evaluation failed: TypeError: Unable to read properties from undefined (reading 'push') Updating this way I managed to solve: You can update yours because of LinkingMethod: please? |
Does webpack exodus supports phone linking method? |
unfortunately not |
@MobCode100 the only problem is that apparently the webcache has a bug regarding sending MP4 however with webpack-exodus the application may have a bug in other parts |
Implement the new Whatsapp Web feature to link with phone number
Description
LinkingMethod.js
- A class that will model the configuration object to choose to link with a QR code or phone number.index.js
LinkingMethod
.index.d.ts
qrMaxRetries
.qr
event.code
event and the newlinkingMethod
property.LinkingMethod
classsrc/Client.js
linkingMethod
src/util/Constants.js
CODE_RECEIVED
event.tests/client.js
linkingMethod
paths.Motivation and Context
Implement the new feature to link with phone number.
How Has This Been Tested
Tested running
npm run shell
andnpm test
. Some tests are failing, but I've confirmed that they're failing on themain
branch too.Types of changes
Checklist