Start a new topic

callJavaScript doesn't work on android

callJavaScript doesn't work on android


I am using wikitude titanium module 5.0.0

callJavaScript doesn't work on android.

 

in ArchitectWindow.js

function ARchitectWindow(WikitudeLicenseKey, url) {

    var wikitude = require('com.wikitude.ti');

    this.window = Ti.UI.createWindow({

        backgroundColor: 'transparent',

        navBarHidden: true

    });

//

//

//

this.window.addEventListener('WORLD_IS_LOADED', function(event){

   Ti.API.info("WORLD_IS_LOADED!!");

   this.arview.callJavaScript("AR.logger.info('script called');");

    }

}

    

 

Somehow It is called in iOS but not in Android.

 

In Both OS 'WORLD_IS_LOADED callback' is called successfully.

Hi daichi,
Have you tried to call `this.arview.callJavaScript("alert('test alert for android')")` to see if a very base JS call can be executed?

Best regards

Andreas

Yes I have tried the simple javascript function alert('test') but in vain.

The same code works on iOS and popup appears..

I suspect ,WOLRD_IS_LOADED is fired before 'the AR is really loaded' ????

It lookes slightly faster to appear  "WORLD_IS_LOADED!! on the screen than AR world appearing on device.

Can you try to put a setTimeout inside the WORLD_IS_LOADED event? 

Best regards

Andreas
Login or Signup to post a comment