Replaced OS is obselete

C#
if(Device.RuntimePlatform == Device.iOS)
{
    //iOS stuff
}
else if(Device.RuntimePlatform == Device.Android)
{
	//Android stuff
}
Source

Also in C#: