【发布时间】:2015-09-21 01:30:45
【问题描述】:
我在 ionic 中找到了一个关于这个主题的帖子:http://forum.ionicframework.com/t/making-phone-call-from-app-href-tel-123/1968/11。
它提到了白名单插件: https://github.com/apache/cordova-plugin-whitelist
所以我尝试在config.xml中添加这些代码,但还是不行。
<access origin="tel:*" launch-external="yes" />
<access origin="mailto:*" launch-external="yes" >
<allow-intent href="tel:*" />
HTML:
<a href="tel: 110">call</a>
错误:
2015-07-03 00:21:16.231 myParking[27167:1006045] 加载失败 网页出错:无法显示网址
我尝试使用另一个插件,但它仍然无法工作。
https://github.com/Rohfosho/CordovaCallNumberPlugin
HTML:
<span ng-click="onDail($index)">call</span>
JS:
var onSuccess = function(){
console.log("success");
}
var onError = function(){
console.log("fail");
}
$scope.onDail = function(index){
window.plugins.CallNumber.callNumber(onSuccess, onError, $scope.ParkingRecords[index].number);
}
错误:
2015-07-03 00:24:09.620 myParking[27308:1007392] 失败
那么我怎样才能做到这一点呢?
离子版本:1.4.3 科尔多瓦版本:5.0.0
【问题讨论】: