Search code examples
xamarin.ioswikitude

Wikitude InjectLocation() in Xamarin Component 5.3.0 for iOS is not working


I am trying to create a simple Wikitude AR Xamarin application with POI functionality. I am using Wikitude component 5.3.0 with iOS 10.2 on iPhone 5S, with Xamarin Studio 6.1.1 and Xamarin iOS 10.0.1.8. I am using MvvmCross to create the PCL library with shared code and trying to create my UIViewController with WTArchitectView. I've created a custom binding for getting location update from myviewmodel. The code for the project is accessible here https://bitbucket.org/ershovd/xamarin-augmented/src.

The problem is that I couldn't get location update and onLocationChanged JS function don't get called. I've setup LocationAlwaysUsageDescription settings and I enable using location information in the app when prompted. I even get location information (latitude, longitude) when debugging. However, when I tried to use InjectLocation() method with specific coordinate info the onLocationChanged handler in JS doesn't get called. Moreover, the IsUsingInjectedLocation on WTArchitectView instance always set to false and doesn't changed to true even when I specify UseInjectedLocation = true;

The similar setup for the Android project works fine, I've attached it as well.

I tried to used official Xamarin example https://github.com/Wikitude/wikitude-xamarin/ but they are outdated. After I upgrade to the latest version and fix some compilation bugs (there is some change in API compare with latest version) it still produce the same results (e.g. onLocationChanged event don't get called and InjectLocation method do nothing.

Did I miss something I need to setup in iOS application for receiving update location update? Why is IsUsingInjectedLocation property always set to false and how can I set it to enabled?

Also, if anybody can provide a working sample of POI at location example for latest Xamarin component version (5.3.0) for iOS this will be very helpful.

Thanks,


Solution

  • The problem was that I pass the wrong enum Wikitude.Architect.WTFeatures value into the method LoadArchitectWorldFromURL. The value which works for me is Wikitude.Architect.WTFeatures.Geo. Here is more detailed answer from wikitude support