<a href="tel:10086">打电话</a>
<a href="sms:10086">发短信</a>
js
window.location.href="sms:"+ mobile;
如果短信不能发送的话,在config.xml 中看看是否有
<access origin="tel:" launch-external="yes"/>
<access origin="geo:" launch-external="yes"/>
<access origin="mailto:" launch-external="yes"/>
<access origin="sms:" launch-external="yes"/>
<access origin="market:*" launch-external="yes"/>
还是不能发送的话,看看控制器里是不是<a href="unsafe:sms:12312312123">xxx</a>
是的话在 services 中引入
.config( [
'$compileProvider',
function( $compileProvider )
{
$compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|tel|file|sms):/);
// Angular v1.2 之前使用 $compileProvider.urlSanitizationWhitelist(...)
}
]);
然后强制刷新页面,基本就解决了。