Start a new topic

transition between .ts and .js

hi,

I am using wikitude for my ionic / cordova application, I am using the sample SnapToScreen : https://github.com/Wikitude/wikitude-sdk-samples/tree/master/07_3dModels_4_SnapToScreen

As i have multiple pages in my app, I call this sample from the page /src/pages/ARView.ts using the function WikitudePlugin.loadARchitectWorld().

I need to communicate with a Bluetooth Low Energy device and i am using an ionic plugin https://github.com/don/ionic-ble-examples

I succeded to scan / connect to my device in ARView.ts, but the problem is that i have to send some data using this plugin on my wikitude Augmented Reality world (snaptoscreen.js) by clicking on a drawable button that i declared like following :


 

var imgSend = new AR.ImageResource("assets/info.png");

World.buttonSend = this.createRequestButton("http://server:port/Info", imgInfo, 0.3, {

 translate: {

 x: -0.2,

 y: -0.45

 }

 }),


 

createRequestButton: function createRequestButtonFn(url, img, size, options) {
    options.onClick = function() {

 

        AR.logger.info(url);

 

        // Call my function from ARView.ts to send data

     };

 

     return new AR.ImageDrawable(img, size, options);

},



I don't know how to call my function located in ARView.ts from snaptoscreen.js 


Thank you for your help im really struggling.

 

1 Comment

Hi,


I'm afraid that Wikitude cannot provide any assistance for Ionic. Not only because we don't provide official support for it, but, more practically, because we (as in all of the SDK developers) do not have any Ionic knowledge or experience. The Ionic extension was developed independently by a third party and we simply provide a download link for it.


For technical support please reach out to the provider. You could also, if this issue is still current, try to reproduce it in our sample app which we provide a generation script for. So the setup process should not be very time consuming.


Thank you for understanding

Wikitude Support Team

Login or Signup to post a comment