If I use above method, I can pass data and poi gets loaded, but I can't pass more than 10 json object because of string limitation? not sure.
any help apprecieated.
A
Andreas Fötschl
said
almost 9 years ago
Hi there!
Please ensure to encode your JSON data properly, so e.g. quotes don't mess up the JS call to the native webview. String length shouldn't be an issue.
Kind regards, Andreas
N
Nisha Shirawala
said
almost 9 years ago
Hi Andreas,
Thank you for looking into this.
so, currently I am replacing '"' with '#' sign to pass data properly and it works, but you mean I should not do that?
Instead of var jsonStringData = JSON.stringify(jsobData).replace(/#/g, '"'); I can only do var jsonStringData = JSON.stringify(jsobData);?
Well, if I don't replace '"' with something else, I cant pass data with callJavascript function.
Also, my json object is a bit bigger, and as I convert it to string, if I have more than 10 JSON objects, my JS function does not get invoked.
I am not using latest wikitude version, will that cause these issues?
A
Andreas Fötschl
said
almost 9 years ago
Hi there!
Do you get any error after execution of the callJavaScript in the console? I'd recommend you to test your POI data injection call in your desktop browser first. You may e.g. declare your method in an empty HTML / script-tag and use console to call the method incl. JSON parameter, or simply declare a dummy function in an existing webpage via debug-console (see attached pic, using www.google.com page in Chrome Browser's console) If you can access JSON data inside your method everything should also work inside ARchitectView's context.
Kind regards, Andreas
N
Nisha Shirawala
said
almost 9 years ago
Hey Andreas,
I was able to load my JSON data after upgrading to wikitude 3.3. I was on 1.2 version and I think that might have issues.
So finally it worked by following code.
var jsonStringData = JSON.stringify(updatedLocations).replace(/#/g, '"');
Nisha Shirawala