joaquinlom / react-native-wikitude-sdk-example

3 stars 1 forks source link

Error launch example Html Drawable #7

Open GianlucaP99 opened 3 years ago

GianlucaP99 commented 3 years ago

Hi, I was testing some examples to check which one could do for me.

it seems very interesting to me the possibility of using Html code in AR.

I would have an error: https://pastebin.pl/view/44d7d163

I reported the error lines.

I take this opportunity to also ask for additional information. is it possible to inject some code into this external html file? I would need to pass the code from React to the World (I do it with the callJavascript method) now the next step is to inject it into the html AR file and not into the index file with the simple document ...

Maybe i could do this by calling the evalJavaScript method when the drawable has finished loading? I prefer to ask for an opinion.

The configuration is the same as described in issue #2

Thank you.

joaquinlom commented 3 years ago

I haven't tested against an HTML Drawable yet, but for that feature, I would implement a global function in the index.html, which will pass the string passed by the callJavascript in React. Just remember that each HTMLDrawable is self contain and you need to have access to the HTMLDrawable outside the AR File. or if you can have only 1 HTMLDrawable simple set the drawable globally and in the callJavascript reference manually callJavascript(htmlDrawable.evalJavaScript('alert("This")'))

GianlucaP99 commented 3 years ago

perfect, thank you so much for the advice on how to inject javascript into html drawable. I am waiting for the resolution of the fatal error generated by the use of html drawables, if you have managed to replicate the error.

joaquinlom commented 3 years ago

I was able to fix it but encounter another bugs while testing. The next version will change how Android support Wikitude

GianlucaP99 commented 3 years ago

Perfect, a bug fix release could be usefull. I would like to test this functionality as well to be able to add it, if interesting in my test project. Thank you

joaquinlom commented 3 years ago

Sure, but because it's only working in the first run , then doesn;t work anymore I don't think it would be useful hehe, You can share it if you want.

GianlucaP99 commented 3 years ago

if the html drawables work only at the first start then I agree that they are not very useful, at this point I continue the implementation of the other types, if a nice example comes out I will share it for sure.