pedroslopez / whatsapp-web.js

A WhatsApp client library for NodeJS that connects through the WhatsApp Web browser app
https://wwebjs.dev
Apache License 2.0
14.53k stars 3.46k forks source link

Live Location support #183

Open rickyrsyah opened 4 years ago

rickyrsyah commented 4 years ago

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?

pedroslopez commented 4 years ago

Yeah, live locations are not handled at the moment. It's definitely something I can look into supporting :)

aliyss commented 3 years ago

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 commented 2 years ago

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))
aliyss commented 2 years ago

@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.

josemontiel95 commented 2 years ago

@Aliyss Any luck adding it within the package?

AlloryDante commented 2 years ago

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.

josemontiel95 commented 1 year ago

I'm still Interested on this feature. Anyone else?

aliyss commented 1 year ago

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?