Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-11635

Passing object to navigator.notification.alert crashes iOS app

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 6.3.0
    • None
    • cordova-plugin-dialogs
    • None

    Description

      Create new project

          $ cordova create foo
          $ cd foo
          $ cordova plugin add cordova-plugin-dialogs
          $ cordova platform add ios
      

      Edit www/js/index.js and replace onDeviceReady with

      www/js/index.js
          onDeviceReady: function() {
              app.receivedEvent('deviceready');
      
              // this crashes the app on iOS
              var dictionary = { error: 'notification plugin is expecting a string'};
              navigator.notification.alert(dictionary);
          },
      

      Run the app

          $ cordova run ios
      

      RESULT: This crashed the app on a device and on the simulator
      EXPECTED RESULT: String or [Object object] in the dialog box or perhaps an error

          $ cordova -v
          6.3.0
          $ cordova platform ls
          Installed platforms:
            ios 4.2.0
          $ cordova plugin list
          cordova-plugin-dialogs 1.2.1 "Notification"
          cordova-plugin-whitelist 1.2.2 "Whitelist"
      

      Attachments

        Issue Links

          Activity

            People

              jcesarmobile jcesarmobile
              dcoleman Don Coleman
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: