【问题标题】:Phonegap notification.alert works only in AndroidPhonegap notification.alert 仅适用于 Android
【发布时间】:2015-06-09 14:46:50
【问题描述】:

我正在使用 cordova 3.4 来构建一个 ios/android 应用程序。 我正在使用此代码来个性化我的警报消息:

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

该代码在 Android 中完美运行,但在 ios 中我在控制台中收到以下消息:

[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)

我错过了什么?

【问题讨论】:

  • 您是否在 config.xml 中添加了以下内容?
  • 是的,在 之间!

标签: android ios cordova notifications phonegap-plugins


【解决方案1】:

我遇到了同样的问题,搜索了几个小时后解决方案很简单,你错过了回调。

navigator.notification.alert(

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

);

希望对你有帮助

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-12-09
    • 2020-01-11
    相关资源
    最近更新 更多