whatsapp-web.js
whatsapp-web.js copied to clipboard
Live Location support
right now, when type of message is location. will got number value's of longitude, number value's of latitude, preview map jpeg file in base64, and value of description if exist and undefined if live location. is possible to get fresh latitude and longitude when share duration is not expired and state of live location still sharing?
Yeah, live locations are not handled at the moment. It's definitely something I can look into supporting :)
Prerequisites: Create a live location from phone. Send it to a chat.
let livelocationModel = mR.modules[36839].default.models[0]
let livelocationParticipant = mR.modules[36839].default.models[0].participants.models[0]
// Register new LiveLocations
mR.modules[36839].default.on('all', (x, y, z) => console.log(x, y, z))
Do u have a complete example? I didn't get it.
Prerequisites: Create a live location from phone. Send it to a chat.
let livelocationModel = mR.modules[36839].default.models[0] let livelocationParticipant = mR.modules[36839].default.models[0].participants.models[0] // Register new LiveLocations mR.modules[36839].default.on('all', (x, y, z) => console.log(x, y, z))
@HugoYG
It's sample code to use live locations. I commented it in case someone wanted to make a pull request themselves.
I haven't gotten around to integrating it within the code. Let me see how I can actually add it within the package. Totally forgot about it.
I'll ping you once the pull request is done.
@Aliyss Any luck adding it within the package?
Hello, is it possible to realtime read live location lat and long from a message you receive?
I want to make a PWA and get users location through whatsapp as PWA's are not allowed to get Location in Background, so the user can just share their live location through whatsapp at a service number.
I'm still Interested on this feature. Anyone else?
Afaik the last time I tested I couldn't get WhatsApp Web to show the live location itself.
@josemontiel95 Do you see the live location in WhatsApp Web?