Using Xamarin.Android and Xamarin.iOS, I need to now the current OS in a shared code section. Be it an enum, an int or a string, it doesn't matter.
I tried this:
System.Environment.OSVersion
Which is always "Unix" with some kernel version informations.
There are info on Android for example like
Android.OS.Build.VERSION
But it needs to be in the Android specific code section. Is there any way of knowing the current OS in a common library?
You can also try this and its probably the best solution I found :
if(Device.RuntimePlatform == Device.iOS)
{
//iOS stuff
}
else if(Device.RuntimePlatform == Device.Android)
{
}