I am integrating a cocos2d-js game into a native iOS app.
At some point I have a Javascript function inside my ios native app with the following code:
var txt = jsb.fileUtils.getStringFromFile("project.json");
But my project.json
is in Document folder instead of in my bundle. So I need to get my Document Folder Path in this Javascript file to have something like this:
var myPath = SomeFunctionToGetPath();
var txt = jsb.fileUtils.getStringFromFile("myPath/project.json");
Anyone having an idea how I should implement SomeFunctionToGetPath
?
Thanks for your help.