Bruce Stuart
Posts: 0
Joined: Fri Oct 24, 2014 4:42 am

navigator.notification.confirm

Hello,

I'm using this code to call the Cordova plugin's for notifications. On my IOS device (and appearantly on the android as well) - Im getting an error message when calling it.

My code:

function confirmdismissed( nbuttonpressed ) {
if ( nbuttonpressed === 1 ) {
nbutton = nbuttonpressed ;
bconfirmed = true ;
}
else {
nbutton = nbuttonpressed ;
bconfirmed = false ;
}

}
function myConfirm(smessage, fcallback , stitle , abuttons ) {
console.log('in myconfirm');
if (stitle === undefined) {
stitle = 'Confirm';
}
if (abuttons === undefined) {
abuttons = ["Ok", "Cancel"];
}
if (fcallback === undefined) {
fcallback = 'confirmdismissed';
}
navigator.notification.confirm(
smessage, // message
fcallback, // callback
stitle, // title
abuttons ); // buttonName
return bconfirmed ;
}

Error message in the IOS simulator log:

Jan 4 15:05:18 localhost TrueBlue COA[24579]: The old format of this exec call has been removed (deprecated since 2.1). Change to: cordova.exec(null, null, "", "confirmdismissed",[null,"Notification","confirm",["Logout ? ","Confirm",["Ok","Cancel"]]]);

so, question, can you help me interpret this error ? what's the right format for the call ?

thanks,
Bruce

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

navigator.notification.confirm

Hi Bruce,

It's seems the common cordova issue with old plugins.

Read more details here: https://github.com/shazron/phonegap-q...

Regards.

Bruce Stuart
Posts: 0
Joined: Fri Oct 24, 2014 4:42 am

navigator.notification.confirm

Yurii,

Thanks. I poked around after your response ... And was looking at other posts here, and the docs from Cordova.... Seems my error for the time being was two things:

  1. When sending along the callback method, I was enclosing it it quotes like this:
    fcallback = 'confirmdismissed'

    Since what's happening is the function actually needs to be assigned to the variable not the string name of it... The code needs to be:

    fcallback = confirmdismissed. // no quotes

    And viola ... It works...

  2. I needed to realize that on the IOS and Android platforms ... Confirm is NON blocking ... So life continues in your code regardless of response ... Unless you put the activity to be completed .... In the callback method :-) ... Unlike what you might do on an HTML site where confirm is blocking.

    I ended up with HYBRID code that works regardless of platform ... Using a hint offered earlier here to, at startup , assign the confirm and alert functions to the Cordova functions if they exist after 'device ready'.

    Thnaks again,
    Bruce

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

navigator.notification.confirm

Hi Bruce,

Thanks for this update.

Regards.

Alex7321365
Posts: 0
Joined: Sun Jan 11, 2015 2:27 pm

navigator.notification.confirm

Hi,
I get this error when I try to use notification.dialogs plugin :
The old format of this exec call has been removed (deprecated since 2.1). Change to: cordova.exec(null, null, "",

Which file I need to update ??

Thanks for your help.

Alex.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

navigator.notification.confirm

Hi Alex,

Please give us your app public link and describe steps to reproduce this problem in your app.

Regards.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

navigator.notification.confirm

Hi Alex,

I've tried this plugin - and it works correctly for me.

It seems you have some other custom plugins that disables cordova to start.

Please check weinre debugger at start of your app.. If you will see something like:

pre

Channel not fired: onPluginsReady
Channel not fired: onCordovaReady

/pre

it means - you have wrongly include some phonegap/cordova plugin.

Regards.

Return to “Issues”