Good Day Outsystems Community


I am currently working on a mobile app where I want to implement  AR. I have been using Wikitude and the Wikitude plugin in the Forge. But when I try to run the function inside the Wikitude plugin for Cordova the system tells me that it cannot read the property of undefined. I'm still new to the Outsystems environment and any help would be greatly appreciated.


Here is how I implement the plugin.


Extensibility Configurations:


{

    "plugin": {

        "url": "https://github.com/Wikitude/wikitude-cordova-plugin.git"

    }

}


I then check if the plugin has been loaded with the following JavaScript:


$parameters.IsAvailable = !!window.WikitudePlugin;


If this returns true, I try to determine if the mobile device that the app is installed on supports AR with the isDeviceSupported function inside the Wikitude plugin. I use the following JAvascript:


var wikitudePlugin = cordova.require("com.wikitude.phonegap.WikitudePlugin.WikitudePlugin");


var onDeviceSupported = function(){

$parameters.IsDeviceSupported = true;

$parameters.Message = "Supported";

};


var onDeviceNotSupported = function(){

$parameters.IsDeviceSupported = false;

$parameters.Message = "Not Supported"

};


wikitudePlugin.isDeviceSupported(onDeviceSupported, onDeviceNotSupported);


But it never executes the isDeviceSupported function. This is just a small example just to se if I can get the AR working. Any help would be greatly appreciated. I know it is something small that I am missing.


Regards

Paul



Prasad Rao wrote:

Hi,

Check the sample app from https://www.outsystems.com/forge/component-overview/6763/wikitude or check the sample app found in post https://www.outsystems.com/forums/discussion/23166/wikitude-cordova-plugin/.

Regards.


HI

Yes I have tried these examples. Here is my oml can you please se check if I'm missing something? 

Hi,

Change the javascript code to below and i believe it should work, I was not able to test this because it was done in Outsystem 10 and I don't have an environment with Outsystem v10 to test it.

var onDeviceSupported = function(){
    $parameters.IsDeviceSupported = true;
    $parameters.Message = "Supported";
    $resolve();
};
   
var onDeviceNotSupported= function(){
    $parameters.IsDeviceSupported = false;
    $parameters.Message = "Not Supported";
    $resolve();
};

var requiredFeatures = [];

var wikitudePlugin = {
    intialize: function(){
        WikitudePlugin.isDeviceSupported(onDeviceSupported, onDeviceNotSupported, requiredFeatures);
    },
};

wikitudePlugin.intialize();


Regards.