-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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: Switch between QR or phone number pairing method #3180
base: main
Are you sure you want to change the base?
Conversation
…app-web.js into webpack-exodus
…app-web.js into webpack-exodus
…ommit for some reason)
…app-web.js into webpack-exodus
…edroslopez#3001) * Change window.Store.ProfilePic.profilePicFind to window.Store.ProfilePic.requestProfilePicFromServer * Prevent breaking v2.2x * refactor: make it more readable --------- Co-authored-by: alechkos <93551621+alechkos@users.noreply.github.com>
b018166
to
b5c64b8
Compare
Co-authored-by: Leandro Matilla <30844484+wis-dev@users.noreply.github.com>
MobCode100 Could you please update your reposirory with last commit? 👉 https://github.com/MobCode100/whatsapp-web.js Im using it in my |
Sorry for late. Done! Thank you very much for your review. |
@alechkos I've removed the need for custom interval by using regular expression to read the JavaScript content. Hope this can be merged soon. |
485fb80
to
acc0f50
Compare
PR Details
The ability to change the preferred login/authentication method either use QR code or pair with a phone number (Linked devices -> Link a device -> Link with phone number instead).
Description
pairWithPhoneNumber
which is an object containing the parameters forrequestPairingCode
function in Client.js. The attributes of this object are:phoneNumber
: Phone number in international, symbol-free format <COUNTRY_CODE><PHONE_NUMBER>showNotification
: Show notification to pair for the specified phone number-intervalMs
: The interval in milliseconds on how frequent to generate pairing code (WhatsApp default to 3 minutes)code
andwindow.onCodeReceivedEvent
event will run a callback once a code has been generated.The
inject
function in Client.js will check if thephoneNumber
option is set, and will switch to phone number pairing mode without running any QR related functions.intervalMs
is the time to wait for the next generation of code to mitigate the problem of expired code.Related Issues
closes ##3370 fixes #3371
Motivation and Context
requestPairingCode
without having to manually utilize the functionHow Has This Been Tested
To run or test this feature, run
node app.js
where app.js contains the following code:The pairing code should be displayed to the terminal every 3 minutes (WhatsApp current default). Developer tools are used to inspect some variables while running in non-headless mode. So far, no issues have been encountered during testing on QR code functions or any other existing features.
Types of changes
Checklist