Start a new topic

loadARchitectWorld not calling callback - Cordova on iOs

loadARchitectWorld not calling callback - Cordova on iOs

1 person has this problem

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.



Hi Mark,

So the issue is solved for you now?



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.

I'm experiencing a similar issue on iOS.

Sometimes the success callback is called - sometimes not. In the latter case the error callback is also not called.

It seems pretty random when and when not the success callback is being executed...

My code:

import React, {Component, PropTypes} from 'react';

export default class ARDemoView extends Component {
    constructor(props) {

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

        // this.sample = {
        //     path: "",
        //     requiredFeatures: [
        //         "image_tracking"
        //     ],
        //     startupConfiguration: {
        //         "camera_resolution": "auto",
        //         "camera_position": "back"
        //     }
        // };

        this.sample = {
            "path": "",
            "requiredFeatures": [
            "startupConfiguration": {
                "camera_resolution": "auto",
                "camera_position": "back"
            "extraData": {
                "key1": "test",
                "key2": "test2"

        this.wikitudePlugin.isDeviceSupported(this.onDeviceSupported.bind(this), this.onDeviceNotSupported, this.sample.requiredFeatures);

    onDeviceSupported() {
        console.log("DEVICE SUPPORTED!");



    onDeviceNotSupported(error) {
        console.log("DEVICE NOT SUPPORTED", error);

    onRequestPermissionSuccessful() {
        console.log('loadArchitectWorld', this.wikitudePlugin);
        console.log('loadArchitectWorld', this.sample.path);
            this.sample.path, this.sample.requiredFeatures, this.sample.startupConfiguration

    onRequestPermissionError(error) {
        /* The error object contains two error messages.
            * userDescription is a end user formatted message that can be displayed with e.g. a JS alert
            * developerDescription is a developer formatted message with more detailed information about the error
        /* Here, the userDescription is used to show a confirmation box which, in case of a positive result, shows the applications settings so that user can grant access. */
        var openAppSettings = confirm(error.userDescription + '\nOpen App Settings?');
        if (openAppSettings == true) {

    onARExperienceLoadedSuccessful() {
        const array = ["a","b", "c", 6];
            World.params = {
                trackerFile: "assets/",
                overlayImage: "assets/imageOne.png",
                thumb: "assets/surfer.png"

    onARExperienceLoadError(error) {
        console.log("LOAD ERROR", error);

    render() {
        return (
                <p>AR View</p>

    .propTypes = {};



I just tested this with our Cordova sample app on an iPhone 8 running iOS 11 and found it to be working. I used version 7.2.1 of the SDK. Have you tried this version yet?

Otherwise I'd be interested to know whether you are having this issue in your own application or our sample app. If it is the former, I'd like you to try using our sample app and checking whether the same thing happens.

We offer a script to conveniently set the sample app up. Here's the documentation page that shows how.

- Daniel

Hi wikitude team,

Any advice on this issue?



Hi everyone ,

I have the same problem as you Huy le on ios   .
but when i rotate the phone i got alert message saying ( setBackButton callback is only availble on android and not on ios ) and then the code inside the callback function is called .

and xcode log give that error :

<MainViewController: 0x10290e3a0> whose view is not in the window hierarchy!

I use cordova sdk v  7.1.2  and IOS11



Thanks for your response.

It is a Cordova Project.

I used cordova plugin latest code, 7.1.2 

Test on iPad and iPhone iOS 11.

Please check my log code above:

this code is not alway called when we launch 

console.log('LoadedUrl: ', loadedURL);



1 person likes this

Hi Huy,

Could you please provide further details on the issue:

  • Which version of the SDK are you using?
  • Are you using the JS API?
  • Are you using any of our Extensions (Titanium, Cordova, Xamarin, Unity)? If yes, which version are you using?
  • please send the crash log
  • What device does this happen with (os Version and model)?
  • Is this happening with the sample app or in your own app? If it happens with your own app, does the sample app work on your device?
  • Send exact steps to reproduce this issue and a video so we can check how we can reproduce this issue



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;

        /* 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") {
      }, 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? 

Hi wiki supporter,

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

Hi Julien,
We already decided to deprecate the document.location = architectsdk:// approach with something new. This will ship later this year. Until then I'm not sure how we proceed with this. You could try to increase the timeout. Otherwise it's a web view internal issue that these location changes are not reported correctly.

Best regards,


Hi Andreas,

Yes I confirm.

Best regards

Hi Julien,
Can you confirm that in case the Wikitude Cordova plugin is not closed, the `onUrlInvokd` callback is not called as well?

Best regards,


Hi Andreas,


Yes document.location changing when an target is recognized. I have tested  : 


var architectSdkUrl = "architectsdk://" + encodeURIComponent(World.targetNameCurrent);
document.location = architectSdkUrl;
}, 300);


But the solution not Working :/


You can see Meteor here :


Best regards,

Login or Signup to post a comment