Support for Wikitude Software Development Kit and tools is coming to an end. All the details can be found here. Kindly note that no new topics can be started on the forum from 21.09.2023. Also, some of the FAQs here (especially license related ones) might become inaccurate.
Hello,
I use cordova for an android and ios app.
I have a page which load the wikitude world by a button click call to :
function AfficheAR()
{
appWikitude = {
requiredFeatures: ["image_tracking"],
arExperienceUrl: "www/ExperienceAR/index.html",
startupConfiguration:
"camera_position": "back"
},
bindEvents: function () {
document.addEventListener('deviceready', appWikitude.onDeviceReady, false);
onDeviceNotSupported: function (errorMessage) {
//alert('Loading AR web view failed: ' + errorMessage);
onARExperienceLoadedSuccessful: function (loadedURL) {
// ... do something when the augmented reality experience finished loading
onARExperienceLoadError: function (errorMessage) {
onURLInvoked: function (url) {
console.log("onURLInvoked");
appWikitude.wikitudePlugin.close();
onBackButton: function () {
console.log("onBackButton");
console.log("onARExperienceLoadedSuccessful : " + loadedURL);
console.log("onARExperienceLoadError : " + errorMessage);
initialize: function () {
appWikitude.bindEvents();
onDeviceReady: function () {
appWikitude.wikitudePlugin = cordova.require("com.wikitude.phonegap.WikitudePlugin.WikitudePlugin");
//appWikitude.wikitudePlugin.setBackButtonCallback(appWikitude.onBackButton);
appWikitude.wikitudePlugin.isDeviceSupported(appWikitude.onDeviceSupported, appWikitude.onDeviceNotSupported, appWikitude.requiredFeatures);
onDeviceSupported: function () {
appWikitude.wikitudePlugin.loadARchitectWorld(
appWikitude.onARExperienceLoadedSuccessful,
appWikitude.onARExperienceLoadError,
appWikitude.arExperienceUrl,
appWikitude.requiredFeatures,
appWikitude.startupConfiguration
);
appWikitude.wikitudePlugin.setOnUrlInvokeCallback(appWikitude.onURLInvoked);
}
};
appWikitude.initialize();
The wikitude world is well loaded and work nice.
On the index.html page i have a button to go back to the previous page but it doesn't work.
I have tested (and it do not work) :
AR.context.destroyAll();
window.history.back();
document.location = 'architectsdk://actionButton?action=close'
How can i exit the wikitude world ?
weber geoffroy
Hello,
I use cordova for an android and ios app.
I have a page which load the wikitude world by a button click call to :
function AfficheAR()
{
appWikitude = {
requiredFeatures: ["image_tracking"],
arExperienceUrl: "www/ExperienceAR/index.html",
startupConfiguration:
{
"camera_position": "back"
},
bindEvents: function () {
document.addEventListener('deviceready', appWikitude.onDeviceReady, false);
},
onDeviceNotSupported: function (errorMessage) {
//alert('Loading AR web view failed: ' + errorMessage);
},
onARExperienceLoadedSuccessful: function (loadedURL) {
// ... do something when the augmented reality experience finished loading
},
onARExperienceLoadError: function (errorMessage) {
//alert('Loading AR web view failed: ' + errorMessage);
},
onURLInvoked: function (url) {
console.log("onURLInvoked");
appWikitude.wikitudePlugin.close();
},
onBackButton: function () {
console.log("onBackButton");
appWikitude.wikitudePlugin.close();
},
onARExperienceLoadedSuccessful: function (loadedURL) {
console.log("onARExperienceLoadedSuccessful : " + loadedURL);
},
onARExperienceLoadError: function (errorMessage) {
console.log("onARExperienceLoadError : " + errorMessage);
},
initialize: function () {
appWikitude.bindEvents();
},
onDeviceReady: function () {
appWikitude.wikitudePlugin = cordova.require("com.wikitude.phonegap.WikitudePlugin.WikitudePlugin");
//appWikitude.wikitudePlugin.setBackButtonCallback(appWikitude.onBackButton);
appWikitude.wikitudePlugin.isDeviceSupported(appWikitude.onDeviceSupported, appWikitude.onDeviceNotSupported, appWikitude.requiredFeatures);
},
onDeviceSupported: function () {
appWikitude.wikitudePlugin.loadARchitectWorld(
appWikitude.onARExperienceLoadedSuccessful,
appWikitude.onARExperienceLoadError,
appWikitude.arExperienceUrl,
appWikitude.requiredFeatures,
appWikitude.startupConfiguration
);
appWikitude.wikitudePlugin.setOnUrlInvokeCallback(appWikitude.onURLInvoked);
}
};
appWikitude.initialize();
}
The wikitude world is well loaded and work nice.
On the index.html page i have a button to go back to the previous page but it doesn't work.
I have tested (and it do not work) :
AR.context.destroyAll();
appWikitude.wikitudePlugin.close();
window.history.back();
document.location = 'architectsdk://actionButton?action=close'
How can i exit the wikitude world ?