This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using AVFoundation; | |
using Foundation; | |
using TheLordOfTheRings.Services;//used for injecting ILogger | |
namespace TheLordOfTheRings.MAUI.Services; | |
public partial class SoundService : IDisposable | |
{ | |
private AVPlayer _player; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Android.Content.Res; | |
using Android.Media; | |
using Android.OS; | |
using TheLordOfTheRings.Services;//used for injecting ILogger | |
using static Microsoft.Maui.ApplicationModel.Platform; | |
using Uri = Android.Net.Uri; | |
namespace TheLordOfTheRings.MAUI.Services; | |
public partial class SoundService : IDisposable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using CoreLocation; | |
using LocationUpdates.Models; | |
namespace LocationUpdates.Services | |
{ | |
public partial class LocationService | |
{ | |
private CLLocationManager _iosLocationManager; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Android.Content; | |
using Android.Locations; | |
using Android.OS; | |
using LocationUpdates.Models; | |
using Location = Android.Locations.Location; | |
using AndroidApp = Android.App.Application; | |
namespace LocationUpdates.Services; | |
public partial class LocationService : Java.Lang.Object, ILocationListener |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using LocationUpdates.Models; | |
namespace LocationUpdates.Services; | |
public partial class LocationService | |
{ | |
public event EventHandler<LocationModel> LocationChanged; | |
public event EventHandler<string> StatusChanged; | |
public void Initialize() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using CoreLocation; | |
using UIKit; | |
using Xamarin.Essentials; | |
namespace sample.iOS; | |
public class RegionMonitor : IRegionMonitor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using CoreLocation; | |
using UIKit; | |
using Xamarin.Essentials; | |
namespace sample.iOS; | |
public class RegionMonitor : IRegionMonitor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using CoreLocation; | |
using UIKit; | |
using Xamarin.Essentials; | |
namespace sample.iOS; | |
public class LocationBackgroundWorker : ILocationBackgroundWorker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ublic class BackgroundWorker : IBackgroundWorker | |
{ | |
/// <summary> | |
/// Timer Cooldown/Delay | |
/// </summary> | |
public const double TIMER_COOLDOWN = 5; //5 seconds | |
//best time according to iOS is from 5 to 15 minutes, | |
//but with 30 minutes it may also work | |
public event EventHandler WorkerStopped; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Current status of background tasks | |
/// </summary> | |
public enum BackgroundTaskStatus | |
{ | |
None, | |
Running, | |
Completed, | |
Failed | |
} |