internal NotificationManager(IToastOptions options)
 {
     this.options                    = options ?? throw new ArgumentNullException(nameof(options));
     this.snackbarExtension          = typeof(ISnackbarExtension);
     this.notificationExtension      = typeof(IDroidNotificationExtension);
     this.androidNotificationManager = NewAndroidNotificationManager();
     this.systemEventSource          = new SystemEventSource(null);
     this.intentManager              = new IntentManager(options, androidNotificationManager, systemEventSource, null);
     this.history                    = new History(intentManager, androidNotificationManager);
 }
 internal NotificationManager(IToastOptions options, IPermission permission)
 {
     this.notificationExtension      = typeof(IIosNotificationExtension);
     this.localNotificationExtension = typeof(IIosLocalNotificationExtension);
     this.options              = options;
     this.systemEventSource    = new SystemEventSource(null);
     this.notificationReceiver = new NotificationReceiver(systemEventSource);
     this.permission           = permission;
     this.history              = new History();
 }
        public IntentManager(
            IToastOptions options,
            IAndroidNotificationManager androidNotificationManager,
            ISystemEventSource systemEventSource,
            IServiceProvider?serviceProvider)
        {
            this.mutex = new object();
            this.tasksByNotificationId = new Dictionary <ToastId, TaskCompletionSource <NotificationResult> >();
            this.options = options ?? throw new ArgumentNullException(nameof(options));
            this.androidNotificationManager = androidNotificationManager;
            this.systemEventSource          = systemEventSource;
            this.logger       = serviceProvider?.GetService <ILogger <IntentManager> >();
            this.intentFilter = new IntentFilter();
            this.receiver     = new NotificationReceiver(this);

            intentFilter.AddAction(IntentConstants.KTapped);
            intentFilter.AddAction(IntentConstants.KDismissed);
            intentFilter.AddAction(IntentConstants.KScheduled);

            Application.Context.RegisterReceiver(receiver, intentFilter);
        }
Esempio n. 4
0
 public NotificationEventProxy(ISystemEventSource systemEventRouter)
 {
     this.systemEventRouter = systemEventRouter;
     systemEventRouter.Subscribe(this);
 }
Esempio n. 5
0
 internal NotificationManager(IToastOptions options)
 {
     this.options           = options ?? throw new ArgumentNullException(nameof(options));
     this.systemEventSource = new SystemEventSource(null);
     this.history           = new History();
 }
Esempio n. 6
0
 public NotificationReceiver(ISystemEventSource systemEventSource)
 {
     requests = new Dictionary <ToastId, Request>();
     UNUserNotificationCenter.Current.Delegate = this;
     this.systemEventSource = systemEventSource;
 }