Start a new topic

navigate from ARview to phonegap view

navigate from ARview to phonegap view


Hi guys, please can someone tell me is it possible to navigate from a loaded world to a phonegap shopping basket page for example, having already loaded the product id to add to the basket ? i wonder if it can be done especially that almost of the docs say that these two world are isolated, how can i do that plz? thx

best regards

Hi Sinda,

for example you could add the document.location directive to an onClick listener of a Button and use this button on one of your Trackables.

e.g.:

options.onClick = function() {

            document.location = "architectsdk://addToShoppingBasket?itemId=5"

};

var pageOneButton = new AR.ImageDrawable(this.imgButton, size, options);


 

var pageOne = new AR.Trackable2DObject(this.tracker, "pageOne", {

drawables: {

cam:

}

});

 


If the user then clicks on that button the function "onUrlInvoke" in file "js/index.js" (if you use the code from the sample app) or any other function you define with:

 

 app.wikitudePlugin.setOnUrlInvokeCallback( pass the function you want to be called here );

 

In that function you are then able to call any other JS function you want. 

 

e.g.:


    onUrlInvoke: function (url) {

       myShoppingBasket.add(url);

    }

 

I hope that helps.

 

Best regards,

Simon
Login or Signup to post a comment