Start a new topic

loadARchitectWorld not calling callback - Cordova on iOs

loadARchitectWorld not calling callback - Cordova on iOs

1 person has this problem


Was this ever confirmed to work? I'm trying to use the sample application code with the success callback in loadARchitectWorld, but it does not seem to ever get called. I can introduce an erroneous load condition and cause the failure callback to fire, but the success one does not even when a world loads. I'm using version 5.1.4-3.2.1.

I found out an interesting fact - somehow it seems as if the AR view is being paused or something.


 If the success callback of loadARchitectWorld is not called and it switch the app to the background and return or do any other "native" UI interaction such as swiping open the settings from top or a double home button press - the view is "re-iniated" and the callback is called. I think this is somekind of bug in the plugin.


Yes, it works now. Somehow our old API was still used for the WTArchitectViewDelegate implementation in our Wikitude Cordova Plugin.

The update is already in our master branch on GitHub.

Best regards

Andreas

Hi Mark,


So the issue is solved for you now?


Greetings

Nicola

Hi Nicola,


No unfortunately it is not - above mentioned behaviour is still happening.

I opened a new topic for it here with example code + behaviour video's.


https://support.wikitude.com/support/discussions/topics/5000088559


Best,


Mark


I've same problem in version Cordova Plugin 5.2.0-3.3.1. 

 

In IOS the callback success is receipt only on return to main app.

In Android it work.

Hi Julien,
I just tried it again with a example application that I freshly created and the callback was called correctly for me.

Are you sure that you use our latest module? Have you tried to add an alert to the onLoaded callback?

Here is a snippet how I tested the functionality:

app.wikitudePlugin.loadARchitectWorld(function successFn(loadedURL) {

                    alert('world ' + loadedURL + 'loaded');

                    /* Respond to successful world loading if you need to */

                    app.isArchitectWorldLoaded = true;

 

                    /* in case the loaded Architect World belongs to the 'obtain poi data from application model' example, we can now safely inject poi data. */

                    if ( architectWorld.requiredExtension === "ObtainPoiDataFromApplicationModel" ) {

                        injectGeneratedPoiJsonData();

                    }

                }, function errorFn(error) {

                    app.isArchitectWorldLoaded = false;

                    alert('Loading AR web view failed: ' + error);

                },

                architectWorld.path, architectWorld.requiredFeatures, architectWorld.startupConfiguration

            );

Best regards,

Andreas

Hello, I have a problem: I'm implementing image recognition with plugin cordova wikitude so, it works very well on Android but doesn't on iOs. This is the snippet on side cordova:

var app = {

 

     isDeviceSupported: false,

 

     initialize: function() {

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

          app.loadARchitectWorld();

     },

 

     loadARchitectWorld: function() {

 

          var example = {

               "path": "www/world/1_ClientRecognition_4_Interactivity/index.html",

               "requiredFeatures": ,

               "startupConfiguration": {

                    "camera_position": "back"

               }

          };

 

          app.wikitudePlugin.isDeviceSupported(function() {

 

               app.wikitudePlugin.loadARchitectWorld(function successFn(loadedURL) {

                    console.log("loadARchitectWorld: "+loadedURL);

                    app.wikitudePlugin.callJavaScript("welcomeAlert()");

 

               }, function errorFn(error) {

                    alert('Loading AR web view failed: ' + error);

               },

               example.path, example.requiredFeatures, example.startupConfiguration

          );

          }, function(errorMessage) {

               alert(errorMessage);

          },

          example.requiredFeatures

          );

     }

};

 

app.initialize();

 

The problem is that in iOs it doesn't enter in callback success (or callback error) of loadARchitectWorld. In this way I can't run the callJavascript. Why??? After the code of my World:

 

var World = {

     loaded: false,

 

     init: function initFn() {

          this.createOverlays();

     },

 

     createOverlays: function createOverlaysFn() {

          this.tracker = new AR.ClientTracker("assets/magazine.wtc");

 

          var imgOne = new AR.ImageResource("assets/imageOne.png");

          var overlayOne = new AR.ImageDrawable(imgOne, 1, {

               offsetX: -0.15,

               offsetY: 0

          });

 

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

               drawables: {

                    cam: overlayOne

               }

          });

     },

};

 


function welcomeAlert() {

     alert("Welcome to World");

     World.init();

}


 

Hi Andreas,

After code refactoring it works with  5.2.0-3.3.1.
But I have the feeling that for each new app launch, when i first scan the target the  onEnterFieldOfVision event is not detect. If I go out of my target, then returns the event is detected.( Only IOS )
This remains to be verified.

Best regards

Hi wiki supporter,

I am facing this issues. on iOS, sometimes it is not calling callback on the first launch.

Hi wikitude team,

Any advice on this issue?


Thanks,

Huy

Here is my code:

  

wikitudePlugin.loadARchitectWorld(function successFn(loadedURL) {
        console.log('LoadedUrl: ', loadedURL);
        /* Respond to successful world loading if you need to */
        app.isArchitectWorldLoaded = true;
  
        app.wikitudePlugin.callJavaScript(stringSent);

        /* in case the loaded Architect World belongs to the 'obtain poi data from application model' example, we can now safely inject poi data. */
        if (architectWorld.requiredExtension === "ObtainPoiDataFromApplicationModel") {
          injectGeneratedPoiJsonData();
        }
      }, function errorFn(error) {
        app.isArchitectWorldLoaded = false;
        app.wikitudePlugin.callJavaScript('alert(\'Launch AR Error!\')');
      },
      architectWorld.path, architectWorld.requiredFeatures, architectWorld.startupConfiguration
    )

 Sometimes, success callback is not called, any advices? 

Login or Signup to post a comment