I created a new Cordova app, installed the Wikitude plugin from Github, entered the trail license key and added. After that I replaced the index.js of the new Cordova app with the complete code of the example from above link:
var app = {
// Url/Path to the augmented reality experience you would like to load
arExperienceUrl: "www/world/index.html",
// The features your augmented reality experience requires, only define the ones you really need
requiredFeatures: ,
// Represents the device capability of launching augmented reality experiences with specific features
isDeviceSupported: false,
// Additional startup settings, for now the only setting available is camera_position (back|front)
startupConfiguration:
{
"camera_position": "back"
},
// Application Constructor
initialize: function() {
this.bindEvents();
},
// Bind Event Listeners
//
// Bind any events that are required on startup. Common events are:
// 'load', 'deviceready', 'offline', and 'online'.
/* Respond to successful augmented reality experience loading if you need to */
},
// Callback if your AR experience did not load successful
onARExperienceLoadError: function(errorMessage) {
alert('Loading AR web view failed: ' + errorMessage);
}
};
app.initialize();
Then I built and run the app on my device. Everything worked fine and of course onARExperienceLoadError() was invoked, because Wikitude was unable to load the URL. Now I added a world from the provided sample files to my project and entered the correct URL (as you can see in the code above). And this is where the problems begin: Nothing happens. It seems onARExperienceLoadedSuccessful() does not get invoked, since I don't get an error and the alert(loadedURL) I added to the onARExperienceLoadedSuccessful() does not appear as well.
What am I missing here, what am I doing wrong?
When I replace the contents of the www directory with the whole sample app provided, every thing works fine. So I guess the plugin and all is installed correctly.
I would really appreciate, if anybody can help me figure this out. Thanks in advance!
A
Andreas Schacherbauer
said
over 7 years ago
Hi Manuel, Might it be that your changes are in the wrong www folder? At least on iOS two www directories exist and one is overwritten by the other at build time. Can you post some screenshots of your IDE or a demo project? That makes it probably easier to find the problem.
Manuel Heidrich