简体   繁体   中英

navigator.notification.alert iOS

My alert on ios project doesn't work. I'm using ionic and angularjs to develop my app.

The problem is that when alert is show, the title is "index.html". Actually I call alert like this:

alert("aaa");

I read that cordova allows to change title, using navigator.notification.alert. But the alert is not show when I call it.

I call alert as below:

.controller('MyCtrl',function(){
$scope.myfunction = function(){


    var success = function(data){
     //do something
};

var failure = function(message){
   navigator.notification.alert(
                                         "This is my Alert text!",
                                         callBackFunctionB, // Specify a function to be called
                                         'Alert Title',
                                         "OK"
                                         );
};

function callBackFunctionB(){
            console.log('ok');
            }

}

});

I add plugin and add key in infoplist following instructions in phonegap documentation.

Anyone can help me?

我试图删除插件并重新安装它,现在它可以工作了。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM