Start a new topic

Load WTC from Documents folder on iphone

Load WTC from Documents folder on iphone

1 person has this problem

Can we load WTC file from Documents folder on iphone ?

Thank you for reply,

I use JS SDK, and I tried this code with static path as a test:

this.tracker = new AR.ClientTracker("file:///var/mobile/Containers/Data/Application/A9F83B3C-B12A-4F30-88EC-3839D6D5F7B8/Documents/",{});

Is this code can do the job ?

Always I receive message of "WTC cannot be loaded".


Hardcoding the path will not work as the path will change upon re-installing the application on the device. Specifically, the hexadecimal pattern will be different. Here are some of the paths I got returned upon successive Xcode debug sessions:






If you however query the path at run-time using the code I provided previously and pass it to the JS environment your code will succeed I imagie.

Assuming you are using the Wikitude Native SDK, you can use the following piece of code directly:            


NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);


NSString *documentsPaths = paths.firstObject;


NSURL *documentsUrl = ;


NSURL *wtcUrl = ;


self.clientTracker = ;



Should you be using the Javascript SDK, you would need to query the path identically and pass the wtcUrl to the Javascript side as the JS API does not provide a means to get this path directly.


Should you be using one of our extensions, the proper way of doing this will yet again be different.

Hi I am downloading "" file at run time from api and saving it to document directory since i do not have access to app bundle. Now tell me how can i tell my imageTarge.js file to refer the "" from document directory ?

Note: i am using wikitude iOS - Javascript sdk

Login or Signup to post a comment