小编Cak*_*ake的帖子

允许在cordova中呼叫(以及地图和邮件)

我一直在努力解决这个问题.在人们从弹出窗口按"呼叫"后,我正试图打电话.有趣的是,当他们点击电话号码时,它会直接拨打电话.但当他们点击"呼叫"时,控制台返回:

ERROR Internal navigation rejected - <allow-navigation> not set for url='tel:06-83237516

码:

控制器:

$scope.callPerson = function() {
    var link = "tel:" + $scope.person.phonenumber;
    var confirmTel = $ionicPopup.confirm({
        title: $scope.person.phonenumber,
        cancelText: 'Cancel',
        okText: 'Call'
    });
    confirmTel.then(function(res) {
        if (res) {
            window.open(link);
        } else {
            console.log('cancel call');
        }
    });
}
Run Code Online (Sandbox Code Playgroud)

config.xml文件:

<access origin="*"/>
<allow-intent href="tel:*"/>
<allow-intent href="mailto:*"/>
<access origin="tel:*" launch-external="yes"/>
<access origin="mailto:*" launch-external="yes"/>
Run Code Online (Sandbox Code Playgroud)

HTML:

<div ng-click="callPerson()"> {{person.phonenumber}}</div>  
Run Code Online (Sandbox Code Playgroud)

使用Mail,它根本不起作用,并返回相同的错误.打开地图也一样.它在PhoneGap测试应用程序中有效,但在部署时无效.

地图代码:

$scope.openmaps = function() {
    var address = $scope.person.adres + ", " + $scope.person.plaats; …
Run Code Online (Sandbox Code Playgroud)

ios cordova apple-maps ionic-framework

5
推荐指数
1
解决办法
7880
查看次数

标签 统计

apple-maps ×1

cordova ×1

ionic-framework ×1

ios ×1