From cfacf96e094ffaee3a4222ecb6e23edfd2c47b01 Mon Sep 17 00:00:00 2001 From: Kaustav Chaudhuri Date: Thu, 18 May 2023 13:20:05 +0530 Subject: [PATCH] Cross Simple Audio implemented. for booking and notifications. --- GMCabsDriverAssistantSolution/App.xaml.cs | 73 ++++++++++++----------- 1 file changed, 37 insertions(+), 36 deletions(-) diff --git a/GMCabsDriverAssistantSolution/App.xaml.cs b/GMCabsDriverAssistantSolution/App.xaml.cs index 6bbb44b..f7faba7 100644 --- a/GMCabsDriverAssistantSolution/App.xaml.cs +++ b/GMCabsDriverAssistantSolution/App.xaml.cs @@ -3,6 +3,7 @@ using GMCabsDriverAssistant.Services; using GMCabsDriverAssistant.Utils; using GMCabsDriverAssistantSolution.Styles; using Plugin.FirebasePushNotification; +using Plugin.SimpleAudioPlayer; using System.Diagnostics; namespace GMCabsDriverAssistantSolution; @@ -59,15 +60,15 @@ public partial class App : Application cancelledBookingResponseDto.PickUPAddress = e.Data["fromAddress"].ToString(); cancelledBookingResponseDto.DropUpAddress = e.Data["toAddress"].ToString(); MessagingCenter.Send(this, nameof(App), cancelledBookingResponseDto); - //if (Device.RuntimePlatform == Device.iOS) - //{ - // if (ShareConstant.IsInForeground) - // { - // var player = CrossSimpleAudioPlayer.Current; - // player.Load("system.wav"); - // player.Play(); - // } - //} + if (Device.RuntimePlatform == Device.iOS) + { + if (ShareConstant.IsInForeground) + { + var player = CrossSimpleAudioPlayer.Current; + player.Load("system.wav"); + player.Play(); + } + } }); } else if (e.Data["category"].ToString().Equals("BookingClearAccepted")) @@ -96,15 +97,15 @@ public partial class App : Application notification.Subject = e.Data["subject"].ToString(); notification.Body = e.Data["notification_body"].ToString(); MessagingCenter.Send(this, nameof(App), notification); - //if (Device.RuntimePlatform == Device.iOS) - //{ - // if (ShareConstant.IsInForeground) - // { - // var player = CrossSimpleAudioPlayer.Current; - // player.Load("system.wav"); - // player.Play(); - // } - //} + if (Device.RuntimePlatform == Device.iOS) + { + if (ShareConstant.IsInForeground) + { + var player = CrossSimpleAudioPlayer.Current; + player.Load("system.wav"); + player.Play(); + } + } }); } else if (e.Data["category"].ToString().Equals("IsTabletInstallation")) @@ -130,15 +131,15 @@ public partial class App : Application { Debug.WriteLine($"{e.Data["category"]}"); MessagingCenter.Send(this, nameof(App), e.Data["category"].ToString()); - //if (Device.RuntimePlatform == Device.iOS) - //{ - // if (ShareConstant.IsInForeground) - // { - // var player = CrossSimpleAudioPlayer.Current; - // player.Load("system.wav"); - // player.Play(); - // } - //} + if (Device.RuntimePlatform == Device.iOS) + { + if (ShareConstant.IsInForeground) + { + var player = CrossSimpleAudioPlayer.Current; + player.Load("system.wav"); + player.Play(); + } + } }); } @@ -148,15 +149,15 @@ public partial class App : Application { Debug.WriteLine($"{e.Data["category"]}"); MessagingCenter.Send(this, nameof(App), e.Data["category"].ToString()); - //if (Device.RuntimePlatform == Device.iOS) - //{ - // if (ShareConstant.IsInForeground) - // { - // var player = CrossSimpleAudioPlayer.Current; - // player.Load("newbooking.wav"); - // player.Play(); - // } - //} + if (Device.RuntimePlatform == Device.iOS) + { + if (ShareConstant.IsInForeground) + { + var player = CrossSimpleAudioPlayer.Current; + player.Load("newbooking.wav"); + player.Play(); + } + } }); }