2

I am integrating a game made with Cocos2d-js into my native app with xcode7. In order to do that, you need to import some resources folder to your xcode project and also a file called project.json. On this project.json you say where your resources files are:

...
"jsList" : [
        "src/resource.js",
        "src/app.js"
    ]
 ...

As it is written above, the app will look for the "src folder" on your project folder however I need to modify this to look for the src folder on my ios app documents folder (The app will download the resources files to this folder where they are ready. So the user will have access to new resources without update the app) I was thinking about change the path to something like this, where "Documents" is a path to get Documents folder:

 ...
    "jsList" : [
            "*Documents*/src/resource.js",
            "*Documents*/src/app.js"
        ]
     ...

But It does not work.

I have also tryied with the following route (I know that this will only work with my simulator) but it does not find anything. /Users/ji/Library/Developer/CoreSimulator/Devices/4798B94F-0D14-4F2C-BDFD-783D43AE7AAC/data/Containers/Data/Application/FCAE6A4D-501D-46A0-A5CF-E5B46E899485/Documents

Does anyone have an idea about how the path is to access to Documents folder.

Thanks in advance for your help.

jiglesiasf
  • 61
  • 4
  • I am confused; how can you have access to both the project source files and the app documents directory, given one is compile-time and the other runtime? – trojanfoe Jan 21 '16 at 11:40
  • Thanks for your comment, What I need is to have access on runtime. Because those files are downloaded from a server outside. – jiglesiasf Jan 21 '16 at 11:42
  • What are you using for development? Cordova, reactNacvtive? – rckoenes Jan 21 '16 at 11:45
  • I am integrating a cocos2d-js game into my native app in xcode 7. Basically what I need is to modify my json to looks like following: "jsList" : [ "'DocumentsPath'src/resource.js", "'DocumentsPath'src/app.js" ] Thanks! – jiglesiasf Jan 21 '16 at 11:47
  • Apologies for my bad explanation, now reedit the question to make it more clear. Hope it is better now. Thanks everyone! – jiglesiasf Jan 21 '16 at 15:01

0 Answers0