Start a new topic

document.location only called once on Xamarin.iOS

document.location only called once on Xamarin.iOS


I have been struggeling and searching for a solution but I just can't get the following issue solved:

The SDK recognizes an image, shows an overlay image and opens a new view in my Xamarin.iOS app (by using document.location = 'architectsdk://markerselected?id={id}' ). When closing the new view and getting back at the scanner view I can scan images, the SDK shows the overlay images but the document.location and thus the arView.InvokedURL += ArView_InvokedURL; in the View is not working anymore. 

The code (partially):

// Xamarin

void ArView_InvokedURL(object sender, ArchitectViewInvokedURLEventArgs e)
            int id = 0;
            var queryParams = HttpUtility.ParseQueryString(e.Url.Query);

            if (int.TryParse(queryParams, out id))

// javascript

var pageEmmeloord = new AR.Trackable2DObject(this.tracker, "emmeloord", {
            drawables: {
                cam: overlayEmmeloord
            onEnterFieldOfVision : function() 

            if(currentId != 2) {
                currentId = 2;
document.getElementById('loadingMessage').innerHTML = currentId;
                var architectSdkUrl = "architectsdk://markerselected?id=2";

                document.location = architectSdkUrl;



I have read on this forum that it possibly had something to do with the number of times the document.location is called so I used a global variable (currentId) to prevent the document.location being called more then once. As said, the overlay is shown so the image had been recognized. Even the loading message is beeing filled. Any ideas about how to solve this? Thanks in advance,


Wikitude SDK (Xamarin): 5.1.4

I'm afraid I cannot descern any issues at first glance.

Would you be comfortable uploading your project somewhere and providing me with the link so I can easily reproduce the issue?

Ideally I would prefer a minimal sample project showcasing the problem that has been stripped of any code that does not pertain to the issue directly.


You can find the project here:

It is a Xamarin.iOS application with an MvvmCross framework, just a Proof of Concept with a few views. You can find the actual scan-login in the Views/ScanViewController.cs

Run the app op a real device, click on the large orange button and scan one of the following images:

- Valk.iOS/Resources/ValkMagazine/June2016/assets/emmeloord.png

- Valk.iOS/Resources/ValkMagazine/June2016/assets/haarlem.png

- Valk.iOS/Resources/ValkMagazine/June2016/assets/almere.png

- Valk.iOS/Resources/ValkMagazine/June2016/assets/schiphol.png

As said before, only the first recognized image will trigger a new View.

Thanks in advance!


Kind regards,



Just a quick update to keep you posted.

I have been out of office yesterday and I'm afraid I will not be able to have a look at your issue today either. I am hoping to be able to get to it on Monday.

Apologies for the delay.

I have been able to reproduce the issue using the project you sent. Unfortunately the solution is not immediately appearent. We therefore will be treating this problem as a bug and schedule it to be examined in one of our upcoming sprints. Sadly I cannot make any guarantees on when exactly this will be. I am hoping we will be able to fit it in the upcoming one right away.

Hi Jacob,


I finally managed to have a closer look on the project you provided.

I tried reproducing the issue you reported with the regular JS SDK, but could not. Repeatedly having the callback function invoked upon recognition works perfectly well. This led me to believe that this is not a bug of the SDK after all.

Some additional digging into your code led me to the AnimatePriceDiscount function which you run asynchronously. Changing this function to be run synchronously makes your application work again. You, of course, don't get the animated price anymore, as the function is now evaluated entirely before updating the displayed price value, but repeatedly opening the advertorial pages upon recognition works as intended. I therefore propose that this is not an issue that needs fixing in the Wikitude SDK.

As I am not very familiar with C#, I'm afraid I don't have any specifics on what the problem is exactly.


Kind regards,


Thanks a lot! I have to digg into the code once again to see if I can animate the price in any other way. Once again, thanks for taking the time to answer my question and look into my code.


Kind regards,


Login or Signup to post a comment