-
Notifications
You must be signed in to change notification settings - Fork 13
/
AppDelegate.cs
30 lines (27 loc) · 1.11 KB
/
AppDelegate.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using Avalonia;
using Foundation;
using Avalonia.iOS;
using Avalonia.Maui;
using AVFoundation;
using CommunityToolkit.Maui;
using Syncfusion.Maui.Core.Hosting;
using UIKit;
namespace AvaloniaSample.iOS;
// The UIApplicationDelegate for the application. This class is responsible for launching the
// User Interface of the application, as well as listening (and optionally responding) to
// application events from iOS.
[Register("AppDelegate")]
public partial class AppDelegate : AvaloniaAppDelegate<App>
{
protected override AppBuilder CustomizeAppBuilder(AppBuilder builder)
{
// See https://learn.microsoft.com/en-us/dotnet/communitytoolkit/maui/views/mediaelement#bypassing-the-ios-silent-switch
AVAudioSession.SharedInstance().SetActive(true);
AVAudioSession.SharedInstance().SetCategory(AVAudioSessionCategory.Playback);
return base.CustomizeAppBuilder(builder)
.UseMaui<AvaloniaSample.Maui.MauiApplication>(this, b => b
.ConfigureSyncfusionCore()
.UseMauiCommunityToolkit()
.UseMauiCommunityToolkitMediaElement());
}
}