1using Firebase.CloudMessaging;
7using Plugin.Firebase.Core.Platforms.iOS;
9using UserNotifications;
14 [Register(
"AppDelegate")]
18 protected override MauiApp CreateMauiApp()
21#warning Remove this line when the issue with the RadioButton control template is fixed in a future version of MAUI https:
25 RadioButtonTemplateWorkaround();
30 [Export(
"application:didReceiveRemoteNotification:fetchCompletionHandler:")]
31 public static void DidReceiveRemoteNotification(UIApplication application, NSDictionary userInfo, Action<UIBackgroundFetchResult> completionHandler)
33 Console.WriteLine(
"Silent data notification received: " + userInfo);
44 completionHandler(UIBackgroundFetchResult.NewData);
47 [Export(
"application:didRegisterForRemoteNotificationsWithDeviceToken:")]
48 public static void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken)
50 Messaging.SharedInstance.ApnsToken = deviceToken;
60 public override bool OpenUrl(UIApplication Application, NSUrl Url, NSDictionary Options)
62 if (
string.IsNullOrEmpty(Url.AbsoluteString))
71 Data = Url.AbsoluteString
96 public override void OnActivated(UIApplication application)
99 base.OnActivated(application);
102 public override void OnResignActivation(UIApplication application)
105 base.OnResignActivation(application);
108 private static void EnsureKeyWindow()
110 if (GetKeyWindow() is
null)
113 UIWindow? Window =
null;
114 if (UIDevice.CurrentDevice.CheckSystemVersion(13, 0))
116 Window = UIApplication.SharedApplication.ConnectedScenes
117 .OfType<UIWindowScene>()
118 .SelectMany(s => s.Windows)
122 Window = UIApplication.SharedApplication.Windows.FirstOrDefault();
126 if (!Window!.IsKeyWindow)
127 Window!.MakeKeyWindow();
135 internal static UIWindow? GetKeyWindow()
137 if (UIDevice.CurrentDevice.CheckSystemVersion(15, 0))
139 return UIApplication.SharedApplication.ConnectedScenes
140 .OfType<UIWindowScene>()
141 .SelectMany(s => s.Windows)
142 .FirstOrDefault(w => w.IsKeyWindow);
144 else if (UIDevice.CurrentDevice.CheckSystemVersion(13, 0))
145 return UIApplication.SharedApplication.Windows.FirstOrDefault(w => w.IsKeyWindow);
147 return UIApplication.SharedApplication.KeyWindow;
150 private static void RadioButtonTemplateWorkaround()
152 Microsoft.Maui.Handlers.RadioButtonHandler.Mapper.AppendToMapping(
"TemplateWorkaround", (h, v) =>
154 if (h.PlatformView.CrossPlatformLayout is RadioButton RadioButton)
156 RadioButton.IsEnabled = false;
157 RadioButton.ControlTemplate = RadioButton.DefaultTemplate;
158 RadioButton.IsEnabled = true;
159 RadioButton.ControlTemplate = AppStyles.RadioButtonTemplate;
override bool OpenUrl(UIApplication Application, NSUrl Url, NSDictionary Options)
Method is called when an URL with a registered schema is being opened.
Represents an instance of the Neuro-Access app.
Contains intent action constants used for inter-component communication within the app.
const string OpenUrl
Action used to open a URL, typically triggered by deep linking.
A set of never changing property constants and helpful values.
Represents an application intent containing an action, optional data, and an optional payload.
The IntentService class is responsible for handling and processing application intents in a cross‑pla...
void QueueIntent(AppIntent intent)
Queues an intent for later processing.
async Task ProcessIntentAsync(AppIntent intent)
Processes a single intent asynchronously.
Base class that references services in the app.
static ILogService LogService
Log service.
static ITagProfile TagProfile
TAG Profile service.
Defines the contract for a service that handles application intents.
RegistrationStep Step
This profile's current registration step.
RegistrationStep
The different steps of a TAG Profile registration journey.