创建一个链接,该链接将打开Viber和WhatsApp并向我发送消息 [英] Create a link that will open Viber and WhatsApp and will send a message to me

查看:329
本文介绍了创建一个链接,该链接将打开Viber和WhatsApp并向我发送消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

周围的每个人都曾经使用IM.在我的网站上,我需要放置一个链接,该链接将打开给定的即时消息应用程序(在PC上和移动设备上),并打开一条发送至我的电话号码的消息-我找不到办法!

Everyone around used to use IM. On my site I need to put a link that will open given instant messaging application (both on PC and on mobile) and open a send message to my number - and I can't find a way!

我想使用某种URL方案来做到这一点,但我只能找到(__number是我的手机号码):

I suppose to use some URL scheme to do that, but all I can find is (__number is my mobile phone number):

<a href="intent://send/__number__#Intent;scheme=smsto;package=com.whatsapp;action=android.intent.action.SENDTO;end">WhatsApp</a>

<a href="viber://add?number=__number__">Viber</a>

(我什至不知道我应该在+1202 ...还是简单的1202 ...(也就是说,是否需要加号)中使用手机

(I don't even know if I should use phone in +1202... or simple 1202... (that is, if the plus is needed)

但是坦率地说,它是行不通的. Viber打开了它的窗口,然后告诉我它不会处理该请求,并且WhatsApp根本没有链接到intent方案(在多个设备和操作系统上进行了测试).

but frankly speaking it won't work. Viber opens its window and then tells me it won't handle that request, and WhatsApp is not linked to intent scheme at all (tested at several devices and OSes).

所以,请您帮我解决这个小问题:什么样的URL可以打开Viber和WhatsApp应用程序,以使站点的访问者可以与我联系?

So I please ask you to help me with this small problem: what kind of URL will open Viber and WhatsApp apps to let visitors of the site to contact me?

推荐答案

您需要的称为深层链接viberwhatsapp的一些示例如下:

What you need is called deep-linking, some examples for viber and whatsapp are:

Viber :

<a href="viber://pa?chatURI=[public account URI]&text=[message text]"> some text </a>

WhatsApp :

<a href="whatsapp://send?abid=[users name]&text=[message text]"> some text </a>

虽然不是深层链接,但您也可以将以下网址(不要在电话上使用+)用于 WhatsApp :

While not a deep link, you can also use the following url (don't use + on phone) for WhatsApp:

<a href="https://api.whatsapp.com/send?phone=0000000">Contact Me</a>


来源:

http://origamiengine.com/deep-linking
https://support.viber.com/customer/en/portal/articles/2872423-深层链接

这篇关于创建一个链接,该链接将打开Viber和WhatsApp并向我发送消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆