2013-03-21 66 views
0

我可以创建一个可以在我的设备上打开其他信使(WhatsApp,微信或其他)的链接吗?可以jQuery的移动链接信使(whatapps,微信或其他)?

我还创建使用正常的短信来短信

document.location.href = "sms:" + $("#ContactNumber").val() + "?body=" + $("#SMSContent").val(); 

的链接是SMS工作得很好,但我的设备上不能检测其他信使应用。

这是可能做的jQuery的移动?

回答

1

我假设你在android的WebView上。

如果你做的东西,如下它会在您的手机

<a href="tel:555-123-4567">

你也可以在此改变为下方的方法来调用自定义的意图

public boolean shouldOverrideUrlLoading(WebView wv, String url) 
{ 
    if(isNumber) 
    { 
     //Get the number from the URL 
     Intent intent = new Intent(Intent.ACTION_DIAL); 
     intent.setData(Uri.parse("tel:12345")); 
     startActivity(intent); 
     return true; 
    } 
    return false; 
} 

读取调用默认的拨号器documentation to tweak more

阅读更多关于URI标准Wikipedia

相关问题