简体   繁体   English

在WhatsApp Web中共享链接以获取数据

[英]Share a link in whatsapp web with get data

I have a web application and in that, I am trying to share a link to WhatsApp web application and Mobile app. 我有一个Web应用程序,其中,我试图共享指向WhatsApp Web应用程序和移动应用程序的链接。

The Mobile app link is working fine. 行动应用程式连结运作正常。

<a target="_blank" href="whatsapp://send?text='http://uaereb.com/property-details/?property_id=41" data-action="share/whatsapp/share"><i class="fa fa-whatsapp whatsapp"></a>

But for the web, the get value is not coming. 但是对于网络来说,获得价值并没有到来。

<a target="_blank" href="https://web.whatsapp.com/send?text=http://uaereb.com/property-details/?property_id=41"></a>

The shareable link is coming as " http://uaereb.com/property-details/?property_id= " in the WhatsApp web. 可共享的链接在WhatsApp网站中以“ http://uaereb.com/property-details/?property_id= ”的形式出现。

Could anyone tell me please what I'm doing wrong? 有人可以告诉我我在做什么错吗?

Instead of = use %3D because whatsapp for web only reads urlencoded language or something like that there for ? 代替=使用%3D,因为针对Web的whatsapp仅读取urlencoded语言或类似的语言? you would use %3F and for spaces in your string you would use %20 您将使用%3F,并且在字符串中使用空格将使用%20

You need to encode the message to be sent. 您需要对要发送的消息进行编码。 https://www.url-encode-decode.com/?_ga=2.169715105.1084578027.1543263981-326105195.1543263981 https://www.url-encode-decode.com/?_ga=2.169715105.1084578027.1543263981-326105195.1543263981

New Update: Nov 2018 新更新:2018年11月

<a href="https://wa.me/?text=<<HERE GOES THE URL ENCODED TEXT YOU WANT TO SHARE>>" data-action="share/whatsapp/share">Share via Whatsapp</a>

And that's it. 就是这样。 No Javascript needed, nothing else needed. 不需要Javascript,也不需要其他。 and if you want go a create a nice Whatsapp icon applying the styles. 如果您想创建一个不错的应用样式的Whatsapp图标。

If you want to know more about url encoding, please follow this link. 如果您想进一步了解网址编码, 请点击此链接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM