whatsapp-web.js icon indicating copy to clipboard operation
whatsapp-web.js copied to clipboard

Live Location support

Open rickyrsyah opened this issue 4 years ago • 8 comments

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?

rickyrsyah avatar May 01 '20 03:05 rickyrsyah

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

pedroslopez avatar May 02 '20 21:05 pedroslopez

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 avatar Jun 07 '21 22:06 aliyss

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 avatar Jul 16 '21 18:07 HugoYG

@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 avatar Jul 16 '21 19:07 aliyss

@Aliyss Any luck adding it within the package?

josemontiel95 avatar Dec 07 '21 01:12 josemontiel95

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.

AlloryDante avatar Jun 12 '22 09:06 AlloryDante

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

josemontiel95 avatar Feb 14 '23 01:02 josemontiel95

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?

aliyss avatar Feb 14 '23 18:02 aliyss