Johann Ish created CB-6439:
------------------------------

             Summary: Re-expose the device absolute path
                 Key: CB-6439
                 URL: https://issues.apache.org/jira/browse/CB-6439
             Project: Apache Cordova
          Issue Type: Improvement
          Components: Plugin File
            Reporter: Johann Ish
            Priority: Minor


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:

# 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
# 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



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to