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

Support returning multiple plugin-result values from native->js

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.0
    • Fix Version/s: 2.6.0
    • Component/s: cordova-ios
    • Labels:
      None

      Description

      Currently, on both Android and iOS, we support calling a plugin with multiple arguments, but only support a single return value.

      If all your return values are json serializable, you can construct a json array or dictionary and return that, and that has gotten us this far.

      However, we have recently added support for sending ArrayBuffers, which are not json serializable. Some plugins require returning data along with an ArrayBuffer result (such as a success indicator).

      We propose adding a new return type to CDVPluginResult (ios) and to PluginResult (android) which is some multi-value container, semantically a list of PluginResult. The types this container supports are the same as we have supported until now, and the current PluginResults implementations can be written in terms-of a list of size 1 so as to support the common case while not diverging implementations.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mmocny Michal Mocny
                Reporter:
                mmocny Michal Mocny
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: