I tested it with an Android 5 device and our latest SDK + Cordova extension. Which hardware & Wikitude sdk version are you using?
Best regards,
Andreas
M
Marton Feovenyessy
said
over 7 years ago
Dear Andreas,
Thanks a lot for your extensive support!
Since then, we decided to develop our AR project on Unity and Vuforia, but its good to know that it's working. :)
Thanks again,
Marton
A
Andreas Schacherbauer
said
over 7 years ago
Hi Marton, In case you want to continue using the Wikitude SDK also in Unity, we just released an update to our Unity plugin which contains a lot of improvements ;)
Best regards,
Andreas
J
Jpvpratas
said
over 7 years ago
Hi Andreas.
This fix works great. Just a very simple question from here on:
on the onURL Invoked method, after we close the plugin, would a simple window.location('index.html');
change the path of where the app is?
A
Andreas Schacherbauer
said
over 7 years ago
Hi Joao, By 'where the app is' you refer to if the Cordova or Wikitude Plugin view is displayed or which web page is loaded (in either Cordova or the Architect web view)?
If your question is about how to close the Wikitude Plugin, you need to call something like app.wikitudePlugin.close();. Changing the window location does not affect if our plugin is shown or not.
I'm not quite sure if I understood your question correctly, so please don't hesitate to follow up with a new question.
Best regards,
Andreas
J
Jpvpratas
said
over 7 years ago
Hi Andreas!
Thank you for your answer and I apologize for the "newbie language" used. And yes, I want the app to navigate to a different page in the cordova view once I close the ARchitect View.
The ARchitect View already closes. However, it goes back to the HTML file that had the index.js embedded. Should I post a different question for that?
Once again, thank you very much for your help. This post has helped me more than the last 2 days of searching :)
A
Andreas Schacherbauer
said
over 7 years ago
Hi Joao, Once the Architect View is closed, navigating in the cordova application can be done independently from the Wikitude Plugin. I'm not a expert in web development, but I heard/read that changing the location might not be the most elegant solution. I could forward the question to our web devs if you want to, they should be able to help you out.
Does calling the 'close' function of our SDK trigger a page redirection/reload of the cordova application? Was there a different page loaded at the moment when you 'opened' the Wikitude Plugin?
Best regards,
Andreas
J
Jpvpratas
said
over 7 years ago
Hi Andreas.
That would be great if you could redirect it.
What happens is that I embedded the index.js in a page, and the index.js file has the URL for the Architect View, which naturally is a different page. I used the method you described (app.WikitudePlugin.close()) and it works, and again naturally, it goes back to the page where the the index.js was embedded.
Best Regards,
Joao Pratas
A
Andreas Schacherbauer
said
over 7 years ago
Hi Joao,
I guess I understood now: What you want is that after the Wikitude Plugin is closed, a different page is shown in the cordova application?
Best regards,
Andreas
J
Jpvpratas
said
over 7 years ago
Hi Andreas.
Exactly. I'm creating a game with a quite linear navigation and the ARchitect View should then lead the user to a different page. :)
Regards,
Joao
A
Andreas Schacherbauer
said
over 7 years ago
Hi Joao, did you tried to call document.location = 'your/custom.html' instead of window.location (in your cordova js file that closed the wikitude plugin)?
Best regards,
Andreas
J
Jpvpratas
said
over 7 years ago
Hi Andreas.
Yes I just tried it and it still doesn't work. I was trying to redirect the app to the start of the application, but not successfully.
My guess is that it's something that has to do with the way i set this up in javaScript:
something tells me that that URL at the top has to come from somewhere.
Any suggestions?
Regards,
Joao
A
Andreas Schacherbauer
said
over 7 years ago
The url that is passed to the onURLInvoked method is the one you assigned in your architect world when calling document.location = architectsdk://.
The relative path that you used in the snippet refers to the main cordova .html file. are you sure that this is the correct path?
Best regards,
Andreas
J
Jpvpratas
said
over 7 years ago
Hi Andreas.
Yes, the test I was doing with the relative path would direct the app to the main cordova file (and that is close to the path I want the app to go to, given that the directory is the same).
In my ARchitect World HTML file i call the sdk to close it like this:
<script> function closeWikitudePlugin(){ document.location = 'architectsdk://action=closeWikitudePlugin'; document.location('../index.html'); } </script>
the document.location with the relative path was just added to desperately try and solve this (needless to say, not successful), however this is the way I'm calling it.
Rivera.migueld