sooluh / adonisjs-whatsapp

:speech_balloon: Connect your WhatsApp Cloud API with AdonisJS.
https://www.npmjs.com/package/adonisjs-whatsapp
MIT License
24 stars 1 forks source link

New Phone Number By Whatsapp is Bigger in Length #1

Closed yashlightyear closed 10 months ago

yashlightyear commented 10 months ago

Description

Phone number id is getting changed when it 18 Character Long. I am passing 122097329108006499 which is getting changed to 122097329108006500

both number are beyond the safe integer range in JavaScript. JavaScript uses a 64-bit floating-point representation, which provides around 15-17 decimal digits of precision. Numbers larger than 2^53 - 1 (which is approximately 9 quadrillion) may not be represented exactly.

Solution

Just Change the type to string rather then number it will solve the issue. 😁

Package version

0.2.4

Error Message & Stack Trace

Unsupported post request. Object with ID '122097329108006500' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api at WhatsAppClient.send (/Users/yashkumar/Documents/Projects/ark_server/node_modules/adonisjs-whatsapp/build/src/WhatsAppClient.js:32:19)

Relevant Information