I have a little question about "ArchitectUrlListener" and "architectsdk://...".
In fact, I don't understand how can I pass data between js and java. Actually, on my drawable, I activate "updateRate:AR.HtmlDrawable.UPDATE_RATE.HIGH" and
"clickThroughEnabled: true", so I can detect click into HTMLDrawables, it works, but I don't know how fire "urlWasInvoked" method in java.
I try "document.location = 'architectsdk://...' " but it nothing happen ..
Where I had wrong ?
Thanks
Thibault Morelle
C
Christophe Brasseur
said
about 10 years ago
Hi !
Be sure you registered the interface to the architectView. Example for Android :
For the rest it seems true, just call "document.location = ..." works for me.
T
Thibault Morelle
said
about 10 years ago
Hi,
Thanks for your answer.
Yes, I call this code inside the AR Activity.
Do you think this problem may be due to the HTMLDrawable ? In fact, I call "document.location" inside the HTML Drawable ;)
Thibault Morelle
T
Thibault Morelle
said
about 10 years ago
Oh Thanks,
It works great =D
W
Wolfgang Damm
said
about 10 years ago
that's exactly the problem. However there is a quite simple solution. A HtmlDrawable has a trigger called onDocumentLocationChanged that is executed whenver a document.location change is detected.
To quickly give you some idea, this should be the only changes to make it work:
new AR.HtmlDrawabel(..., {.. onDocumentLocationChanged: function onDLCfn(uri) { if (/*uri starts with architectsdk://*/) { document.location = uri; } }
Thibault Morelle