Start a new topic

Load WTC from Documents folder on iphone

Load WTC from Documents folder on iphone

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.
Login or Signup to post a comment