Wikitude InjectLocation() in Xamarin Component 5.3.0 for iOS is not working - xamarin.ios

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,

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

Related

Does MtouchSdkVersion setting affect what version of iOS we can run on?

When deploying an existing Xamarin forms proj from Visual Studio I was getting errors like "Failed to load AOT module ‘System.Net.Http’ while running in aot-only mode". This had worked in the past, it seemed Xcode had recently updated before I hit the problem. I found I was able to get the project deploying by changing the csproj entry 10.0 to 10.3. It looks like I could change this setting and everyone would be ok if they also had updated xcode.
My concern is: Does this change what versions of iOS the application can support? Would it have any other surprises when deployed to the apple store?
One thing I don't understand is I am the only person seeing this issue. Another developer is able to deploy to an iOS device (iPad instead of an iPhone) that also has the latest version of iOS without problems. Running “xcodebuild -version” shows we have the same version of xcode installed (8.3.1) and running “xcodebuild -showsdks” shows we have the same iOS sdk available (iOS 10.3).
There is some good documentation on the iOS SDK version: https://developer.apple.com/library/content/documentation/DeveloperTools/Conceptual/cross_development/Overview/overview.html#//apple_ref/doc/uid/20002001-BABEBGCF
You can build against a higher version of the SDK and run against lower versions of iOS.
Building against different versions of the iOS SDK can cause differences in behavior, these may show as regressions in your application.

Get App Store Country with Xamarin

I'm developing an app for iOS and Android with mvvmcross but now I have following problem...
In my Core PCL I must done some operation depending on which is the App Store of download.
For translation I have resolved using custom json, TextProviderBuilder and to get language
System.Globalization.CultureInfo.CurrentCulture.ToString()
Now I'd like to have information on store that must be different to language.
UPDATE
As suggested by Cheesbaron, that is a platform issue that must be resolved in each View. Than how it's possible to access to that information on Xamarin Android and iOS?

How to add Storage reference?

This should be pretty straightforward, but can't work this out for myself I'm afraid!
The following line of code triggers the error:
using Microsoft.Xna.Framework.Storage;
Error: The type or namespace name 'Storage' does not exist in the
namespace 'Microsoft.Xna.Framework' (are you missing an assembly
reference?)
But as far as I can tell, I have added the reference: (Solution explorer -> right click References -> Add reference -> .NET tab -> scroll down to Microsoft.Xna.Framework.Storage -> select it -> click OK).
Microsoft.Xna.Framework.Storage shows up when I expand "references" in the solution explorer.
What am I missing?
EDIT
Okay on second look this might be to do with how I'm adding the references. When I search in the object browser Microsoft.Xna.Framework.Storage doesn't show up (but when I search, for example, for audio, Microsoft.Xna.Framework.Audio does show up). Is there anyway to check that when I click "OK" on the add reference pop-up that it is actually working?
I see two likely possibilities.
You have a mismatch of XNA 4.0 and XNA 3.1 (or previous) references in your project. If the Storage reference you added is from 3.1, you'll get this message. You can try removing it, and then looking specifically for the 4.0 version during add.
The device you are building for may not support the Storage mechanism. In particular, Windows Phone apparently uses a different storage mechanism (System.IO.IsolatedStorage http://msdn.microsoft.com/en-us/library/ff604992.aspx).
Hope one of these helps.
This question was asked a long time ago, but if anyone else is still looking for an answer, here is how i fixed it.
If you installed the Microsoft.Xna.Framework references by using the installer from Microsoft, then it installs in C:\Windows\Microsoft.NET\assembly. I found all of the Xna libraries in GAC_32 and Microsoft.Xna.Framework.Storage in GAC_MSIL.
You can also use the GAC to find libraries that aren't in Visual Studio's reference list. For .NET Framework versions before 4.0, the libraries are in C:\Windows\assembly, and the libraries for versions after 4.0 are in C:\Windows\Microsoft.NET\assembly.
It's actually been removed from Monogame by Microsoft.
Running: Windows 10, with integrated graphics card (Intel G45/G43), Visual Studio 19, Monogame 3.7.1
Project Structure: Solution > Game.Shared, Game.Android, Game.OpenGL (followed this guide on creating a Cross-Platform project, method number 3).
I changed the Target Framework in my OpenGL project from .NET 4.5 to .NET 4.7.x (the newest version), and I was able to build and deploy the app to an Android device. Do this by clicking the project and selecting Properties.
I simply commented out the line. App will successfully deploy to an Android device this way. The game will then deploy, but I can't get any content to load.
Have yet to see if I can deploy to an iOS device, I will update this post when I figure out if I can.
No nuGet's installed.

Monotouch setting the Application Bundle Version

I'm trying to set the Application version for my MonoTouch project, but it doesn't seem like I have found the right location.
I've tried setting the version to 2.0.0 under:
the Solution>General>Main Settings>Version field
the Project>General>Main Settings>Version field (which can inherit from the solution)
the Info.plist>iOS Application Target>Version field
If I check the version using
string currentVersion = NSBundle.MainBundle.InfoDictionary["CFBundleVersion"].ToString();
I only ever get back 1.0 as the version. Am I missing a place to set the application version, or do I need to use a different method for checking the BundleVersion?
Here is the version info I am running
MonoDevelop 3.0.5
Installation UUID: 554868b3-3202-4955-bf88-38a3e5949a79
Runtime:
Mono 2.10.9 (tarball)
GTK 2.24.10
GTK# (2.12.0.0)
Package version: 210090011
Apple Developer Tools:
Xcode 4.5.1 (1842)
Build 4G1004
Monotouch: 6.0.6 (Evaluation)
Doing the same change in my own Info.plist file works perfectly with the code you provided, i.e. I do get the expected 2.0.0 string. I also tried it inside the iOS simulator since you're using the evaluation version.
I do have newer versions of the softwares - but they are not very different and I do not recall anything changed in those area.
Can you look (and maybe add it in your question) the content of your Info.plist ? it should be an XML file (default format used by MonoDevelop) and should have your 2.0.0 string inside it.
If that does not work please zip a small sample that do so and attach it to a bug report as there might be something that does not, always, get updated ?!?

Update Xcode project to iOS 4.1

I started a project under iOS 3.1 and I stopped developing for a while. Now I installed the new SDK with iOS 4.1. If I wanna build now, there is a error message which says "There is no SDK with the name or path 'iphoneos3.1', which actually make sense.
So how can I "upgrade" my project to iOS 4.1?
thx
In the project settings search for base SDK and set this to 4.1. You might set the deployment target to 3.x on the targets' info page (that is if you want to target 3.x, of course).

Resources