Phonegap notification.alert works only in Android

322 views Asked by At

I'm using cordova 3.4 to build a ios/android application. I'm using this code to personalize my alert messages:

navigator.notification.alert(
    'message',  // message
    'title',            // title
    'name'                  // buttonName
);

That code work perfectly in Android, but in ios i get the following message in the console:

[Log] The old format of this exec call has been removed (deprecated since 2.1). Change to: cordova.exec(null, null, "", "Ok",[null,"Notification","alert",["message","title","name"]]); (console-via-logger.js, line 173)

What am I missing?

1

There are 1 answers

0
Santiago109 On

I had the same problem , after been searching several hours the solution its quite simple, you are missing the callback.

navigator.notification.alert(

'message',  // message
null,   //callback function   <-----------
'title',            // title
'name'                  // buttonName

);

I hope it helps you