Hi Dennis
You need to use architectView.callJavaScript() to inject your values or host html on a server to pass params via url.
Maybe the examples provided below can also help you
Thanks
Eva
So I put
architectView.callJavascript("World.getDataFromNative("+testurl+");");
in the onPostCreate() and
getDataFromNative: function getDataFromNativeFn(data){
var url = data;
},
var htmlarea = new AR.HtmlDrawable({
uri: url
}, 0.4, {
viewportWidth: 900,
viewportHeight: 600,
backgroundColor: "#FFFFFF",
offsetX: -0.352,
offsetY: -0.464,
horizontalAnchor: AR.CONST.HORIZONTAL_ANCHOR.LEFT,
verticalAnchor: AR.CONST.VERTICAL_ANCHOR.BOTTOM,
clickThroughEnabled: true,
allowDocumentLocationChanges: false,
onDocumentLocationChanged: function onDocumentLocationChangedFn(uri) {
AR.context.openInBrowser(uri);
}
});
in my JavaScript.
But it doesnt seem to work. I dont know if I make a misstake with js or if I use the method to pass the value.
Please use WebView debugging to analyse the console.
I guess you just forgot to add the quotes, it should be
architectView.callJavascript("World.getDataFromNative('"+testurl+"');");
Best regards,
Andi
Dennis Dähn
Hi
Normally I would pass a Value from my Android class to JavaScript with something like this:
But this doesnt seem to work for the Architect view. So is there a way to pass a value from an Android Class to the Javascript running in the architect view?
Some example snipped would be nice
Thanks for your help in advance.