cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Becky Gibson (JIRA)" <>
Subject [jira] [Commented] (CB-285) Add property returning root path of PhoneGap files
Date Tue, 05 Feb 2013 19:36:15 GMT


Becky Gibson commented on CB-285:

For iOS I'm not sure that I understand why you want to change the PERSISTENT directory out
of <application-home>/Documents into <application-home>/Library/CdvPersistent?
 The iOS documentation that you reference explicitly states for <Application_Home>/Library/,
"You should not use this directory for user data files."  I could see adding a USERDATA setting
if you want to make a distinction between user data and app data, although then we are deviating
from the W3C spec.

I'm also not sure I understand the need for a way to retrieve the <application-home>
directory - why would an app want to write here?  I can see why the user might want the APP_ASSETS
in order to obtain a full path to the www directory but I think that would be confusing in
the File APIs since this is read only.  Generally by convention in the core plugins file names
with w/o a full path are treated as coming from te www directory.  At least this is what media
does and we could standardize any other core plugins that do not use this convention. 

While we are thinking about directory names and locations,  I am looking at fixing CB-571
where iOS requires the file to exist before recording.  If the user just passes in a file
name,  I was going to create and store the recording in the <application-home>/Documents
directory since it is user generated and should be backed up.  I'm not sure how this flies
in the face of your proposed conventions for the File api - I guess the dev could get to these
recorded files later using the proposed APP_HOME and appending /Documents to access the directory?
 Or are you proposing that recorded files would also go in the <application-home>/Library/CdvPersistent

> Add property returning root path of PhoneGap files
> --------------------------------------------------
>                 Key: CB-285
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: CordovaJS
>    Affects Versions: 1.4.0
>         Environment: Both PhoneGap SDK and PhoneGap Build
>            Reporter: Ashley Gullen
>            Assignee: Andrew Grieve
>              Labels: features
> There needs to be a property in PhoneGap that returns the root path to the general files
added to the PhoneGap project (i.e. the directory index.html is in).  For example, if I add
'music.mp3' to my project, in Android it will be located in:
> /android_asset/www/music.mp3
> On iOS after being built with PhoneGap Build it will be located in some path like this:
> /var/mobile/Applications/<app_ID>/<name>.app/www/music.mp3
> However, there does not appear to be a programmatic way to determine both <app_ID>
and <name>.app.
> This has two side effects:
> 1. Paths to audio for Media must be hard-coded separately depending on the platform,
which is inconvenient.
> 2. Paths to audio for Media cannot be known if developing a framework that uses PhoneGap.
 Since a framework does not know the App ID or name in advance, it's impossible for the framework
to determine the correct path.
> This is actively blocking audio from working on iOS in PhoneGap projects exported by
Construct 2 (, a HTML5 game creator.  Also, it seems like kind of an important
function to make available anyway, since hard-coding paths for each platform is a pain.
> This PhoneGap Support thread led to this issue:

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message