- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Been building the same app for a while now, made some minor changes and now I get an error when attempting to display a notification.alert.
Wondered why this was happening as my alerts no longer appear.
The old format of this exec call has been removed (deprecated since 2.1). Change to: cordova.exec(null, null, "", "Error",[null,"Notification","alert",["The verification code or your name is entered incorrectly","OK","OK"]]);
This error does not occur on App Preview or under emulation, only when the app is installed on iOS, the Android version seems OK.
- Tags:
- HTML5
- Intel® XDK
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Could you post your Cordova Alert code?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My Code is below, I have changed the URL for security, there error occurs here navigator.notification.alert("The verification code or your name is entered incorrectly", "Error","OK");
function getTeams(sel) {
$("#teamslist").empty();
$("#mydetails").empty();
var myfirst = $("#firstname").val();
var mylast = $("#lastname").val();
var myname = myfirst+" "+mylast;
var mydiv = $("#division").val();
var vcode = $("#vcode").val();
if (mydiv != "[Select Division]") {
localStorage.setItem("mydiv", mydiv);
var sqlstr = "http://myurl/getdata.php?div="+mydiv+"&vcode="+vcode+"&yourname="+myname;
var xhr = new XMLHttpRequest();
xhr.open("GET",sqlstr,false);
xhr.onload = function(){
if(xhr.status==200)
{
jsonArray = $.parseJSON(xhr.responseText);
if (jsonArray.length == 1) {
for(i=0; i < jsonArray.length; i++)
{
team = jsonArray.team;
localStorage.setItem("myteam", jsonArray.team);
//document.getElementById("team").value = jsonArray.team;
}
setTeam();
}
else
{
navigator.notification.alert("The verification code or your name is entered incorrectly", "Error","OK");
}
}
else if(xhr.status == 404)
{
navigator.notification.alert("Web Service Doesn't Exist", "Error","OK");
}
else
{
navigator.notification.alert("Unknown error occured while connecting to server", "Error","OK");
}
}
}
xhr.send()
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think I may have answered my own question, I had missed the callback option out of the navigator.notification.alert options, I have now added null (As there is no callback) and it seems to have fixed the issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That's great!
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page