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

Re-expose the device absolute path

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • cordova-plugin-file
    • None

    Description

      To prevent coupling, this plugin should again expose a way to get the absolute path to a file on the device. While it breaks from the W3C File API standard, it allows for a cleaner design as third-party plugins don't have to be coupled with the File plugin.

      I ran into this issue after updating the File plugin and in conjunction with the EmailComposer plugin (http://plugins.cordova.io/#/package/emailcomposer). That plugin expects attachment paths to be absolute (fully-qualified) on the device. Because the File plugin no longer provides any way to get the absolute path, the two options I've found for a plugin such as EmailComposer are:

      1. Allow paths relative to the `NSBundle bundlePath` and let the user of the plugin guess at where the File plugin put them (e.g., "../Library"), or
      2. Check to see if the File plugin is loaded and ask it to read the file.

      Both of these are workable solutions, but (1) is just brittle, and (2) requires some coupling at the Objective-C level and intimate knowledge of the File plugin.

      See also my comment on the "emailcomposer" plugin at https://github.com/steve-jansen/cordova-ios-emailcomposer/issues/6#issuecomment-40287410

      Attachments

        Activity

          People

            jasongin Jason Ginchereau
            raztus Johann Ish
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: