Start a new topic

OutSystems - other ways to load Architect.js?

I'm currently building a wikitude app using OutSystems and the cordova plugin.
However OutSystems doesn't allow me to add the Architect.js directly into the page.

I've tried adding it dynamically with javascript but I get an
"Cannot set property 'onPlatformAssistedTrackingAvailabilityChanged' of undefined" error. What makes me thing it didn't load Architect.js properly.
So is there any other way I can call on Architect.js?

Is there anyone here that can point me in the right direction?


Hi Eric,



that looks indeed like the architect.js file is not loaded. May I ask how you tried to load it dynamically from Javascript?


A request to https://www.wikitude.com/libs/architect.js needs to be sent to web view the JavaScript part of the Wikitude SDK is running in. We intercept this exact request and provide the actual data from locally stored data. How this request reaches the web view, seems to me, to be irrelevant. Having said that, I have never seen it done other than with a static script in the index.html file, nor am I an expert in web technologies.


Maybe something like this would work.



- Daniel


Hi Daniel,

 The javascript we are using is the following.

It was based on the code you linked to

var script_src = 'https://www.wikitude.com/libs/architect.js';

jQuery.loadScript = function (url, callback) {
    jQuery.ajax({
        url: url,
        dataType: 'script',
        success: callback,
        async: false
    });
}

if (typeof someObject == 'undefined') $.loadScript(script_src, function(){
    console.log('wikitude loaded')
});

 

Login or Signup to post a comment