I am working on a app in Xamarin.Forms that has a button for books. I want it to open iBooks if the OS is iOS and Google play books if it is android
I have the iBooks Part down but How would I open google play books from the button click in the android version of the app?
Heres my xaml code:
<StackLayout Orientation="Horizontal" MinimumHeightRequest="30" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand">
<Button Image="books.png" HorizontalOptions="CenterAndExpand" BackgroundColor="Transparent" Clicked="OpenBooks" />
<Button Image="settings.png" HorizontalOptions="EndAndExpand" BorderColor="Transparent" BackgroundColor="Transparent" Clicked="gotosettings" />
</StackLayout>
Heres My C# code:
public void OpenBooks(object sender, EventArgs e)
{
switch (Device.OS)
{
case TargetPlatform.iOS:
Device.OpenUri(new Uri("itms-books"));
break;
case TargetPlatform.Android:
//open google play books code here
break;
}
}
any help would be amazing!
Thank in advance!