Get App Store Country with Xamarin - xamarin.ios

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?

Related

xamarin.forms integration of zendesk chat

I am new to Xamarin development. And, currently I want to integrate the zendesk chat.
As per my RnD and after contacting Zendesk support center they are not supporting the xamarin yet.
Currently they have sdk for native android and ios respectively.
I need you expertize people's guidelines for the development regarding what scenario i should follow to achieve the same using xamarin.forms :
Integrate the both platforms native sdk's for xamarin in each platform and later call it from Xamarin.Forms by adding platform dependency using Device.OnPlatforms . ( I am not sure about this scenario, please suggest)
Create a jar/aar of Zendesk SDK and use it using binding library concept.( I am not sure it will be accessible into ios platform)
Kindly, suggest me the best approach for this.
Any sample reference for suggestions will be grateful.
Thanks in advance.
I think it's a mix of number 1 and number 2 (and a little extra).
You will need to create the Binding libraries for both iOS and Android. Xamarin has a good documentation of how to do this: Android/Java and IOS/Objective-C
Then you can go either with Xamarin Native (Xamarin.iOS and Xamarin.Android projects) adding the binding to each project. Or you can go with Xamarin.Forms but this will require a little more work as you will need to create an interface of the methods you want to use from the SDKs (most likely all off them) and create the implementations for each platform.
Let's say your interface is called: ISendeskSdkService you will need at least two implementations: ISendeskSdkServiceiOS and ISendeskSdkServiceDroid. These implementations will be on the Platform project and they will be calling the binding libraries you just created and added to each of these projects.
You will be developing your app on top of your interface and which implementation to use will be set on the application load when you are configuring your IoC.
Hope this gives you an idea.

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,
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

Code works on Android and iOS - why can't I move it into a PCL?

I have a static class that uses
System.IO.Path
System.IO.Directory
System.IO.File.
Currently, the class is in my iOS project and unchanged also in my Android project.
I created a PCL that targets Android and iOS only.
However, neither one of the namespaces is available.
I presume that is because iOS and Android alone are not suitable for a PCL profile and that's why Windows Store 8 or Silverlight 5 gets added and that removes the System.IO.* namespaces.
Is this working as designed? Is file linking my only chance in this case?
Yes, for now this is the way it's supposed to work. You can use something like my PCL Storage library to access the file system from a PCL, or you can simply use file linking.
As a side note, I'd recommend choosing Windows Store and .NET 4.5 along with the Xamarin targets. That profile is going to give you more APIs than the one which targets Silverlight 5 which you get by default when you just choose Xamarin platforms in that dialog.
System.IO.Path, System.IO.Directory and System.IO.File are partially supported in PCL profile EXCLUDING silverlight 5: WP8 + NET4.5 + Xamarin + iOS.
Path.Combine works perfectly in this targeted PCL.

Xamarin licensing issue (can I use specific component)

I saw this SO question asking for a PDF viewer for MonoTouch, which is just what I need. First I tried the Xamarin code sample suggested by poupou, but this needs a lot of extra work to use. So I decided to try the mTouch-PDFViewer suggested by Alex.
So I went to the download page and on to the GitHub for this component and cloned the repository. The problem is that the Visual Studio solution opens with a message saying I need a different license for Xamarin than I have. I only have a Xamarin Indie license and am therefore not able to build this library.
Is there a way around this? If I copied all the code into the Xamarin Studio, would it work then or can't I use this component at all due to licensing problems? Will it work in the app as long as I get hold of the dll file or do I need the more expensive license?
I have sent an email to the support email address for the mTouch-PDFViewer asking if the dll is available somewhere, but I was wondering in general if the licensing limits the use of dlls or just the ability to compile the code.
Indie license does not have Visual Studio support. An Indie license requires you to use Xamarin Studio on a Mac. There should not be any restrictions on using specific components.
Also, for basic PDF viewing, iOS has excellent built in support, which you might try before using a 3rd party component.

Need help Android and iOS-App developed on Xamarin

Need some help on xamarin Platform. I understand it can be used to develop Android-base and iOS-base App on Xamarin. I have the following questions:
For Android and iOS-based app develop on Xamarin, can the app run on Android-tablet ad iOS-tablet respectively? what I need to do for both tablets respectively?
If there are new controls for android and iOS, how Xamarin will update this for development?
1) Yes they can run on Android Tablet and iPad. Your code logic would remain the same but you would need to provide for the UI since the resolutions are different.
For iOS, Xamarin makes it simple by providing for a Universal template which allows you to provide different layouts for iPhone & iPad.
For Android, there is no template as such but the process remains the same just as you would for phones with different resolutions.
2) Assuming you are talking about the default controls, they will made available in the Xamarin framework via their regular update channels. First they are in Alpha, then in Beta and once the bugs have been ironed out, they are made available to Stable channel which can then be used in the production apps safely.
I would recommend you go through their docs which are quite good and explains this whole thing in quite detail. Xamarin Docs

Resources