如你所知,在iphone上使用whatsapp的url方案,我可以创建以下链接:
href="whatsapp://send?text=blahblah"
由于ios上的url方案支持,这是可能的。
我正在尝试为android设备创造类似的效果。(但没有抛出android应用程序,只是一个普通的html页面)。
据我理解,它应该是这样的:
href="intent://send/#Intent;scheme=whatsapp;package=com.whatsapp;s.text=test;end;"
或者:
href="intent://send/#Intent;scheme=whatsapp;package=com.whatsapp;text=test;
action=android.content.Intent.ACTION_SEND; end"
或者:
href="intent://send/#Intent;scheme=whatsapp;package=com.whatsapp;text=test;
category=android.intent.category.BROWSABLE;end"
如你所见,我真的在黑暗中摸索。我在stackoverflow上找到的所有答案都是关于如何生成抛出android应用程序的意图。
但这不是我的情况,我想在PHP/ASP服务器上为一个html页面生成一个href。
有人吗?谢谢!
发布于 2014-11-17 06:05:27
whatsapp现在正式支持Android上的url方案(Yey)!
<a href="whatsapp://send?text=Hello%20World!">Hello, world!</a>
发布于 2014-07-04 17:07:07
也在解决同样的问题,并找到了解决方案:
href="intent://send/[countrycode_without_plus][number]#Intent;scheme=smsto;package=com.whatsapp;action=android.intent.action.SENDTO;end
电话号码(+49 123 456 78)
href="intent://send/4912345678#Intent;scheme=smsto;package=com.whatsapp;action=android.intent.action.SENDTO;end
发布于 2015-12-16 16:45:25
Whatsapp url方案只为跳转消息发送屏幕保存ids或数字。Android处理新电话号码的消息活动。
此脚本查找手机操作系统,并为手机操作系统创建链接。
$(document).ready(function () {
if (matchMedia) {
var mq = window.matchMedia("(max-width: 991px)");
mq.addListener(WidthChange);
WidthChange(mq);
}
function WidthChange(mq) {
var isMobile = {
Android: function () {
return navigator.userAgent.match(/Android/i);
},
BlackBerry: function () {
return navigator.userAgent.match(/BlackBerry/i);
},
iOS: function () {
return navigator.userAgent.match(/iPhone|iPad|iPod/i);
},
Opera: function () {
return navigator.userAgent.match(/Opera Mini/i);
},
Windows: function () {
return navigator.userAgent.match(/IEMobile/i);
},
any: function () {
return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows());
}
};
if (mq.matches) {
if (isMobile.Android()) {
$("a").attr("href", "intent://send/+905055555#Intent;scheme=smsto;package=com.whatsapp;action=android.intent.action.SENDTO;end");
} else {
$("a").attr("href", "tel:+905555555555");
}
};
}
});
https://stackoverflow.com/questions/21500570
复制相似问题