Example #1
0
        public override void Register(IServiceCollection services)
        {
            if (this.delegateType != null)
            {
                services.AddSingleton(typeof(INotificationDelegate), this.delegateType);
            }

            services.TryAddSingleton <INotificationManager, NotificationManager>();
#if __ANDROID__
            services.AddSingleton <AndroidNotificationProcessor>();
            services.RegisterJob(new Jobs.JobInfo(typeof(NotificationJob))
            {
                Repeat      = true,
                IsSystemJob = true
            });
#elif __IOS__
            services.TryAddSingleton <iOSNotificationDelegate>();
#elif WINDOWS_UWP
            UwpShinyHost.RegisterBackground <NotificationBackgroundTaskProcessor>(builder =>
            {
                builder.SetTrigger(new Windows.ApplicationModel.Background.UserNotificationChangedTrigger(Windows.UI.Notifications.NotificationKinds.Toast));
            });
            services.RegisterJob(new Jobs.JobInfo(typeof(NotificationJob))
            {
                Repeat      = true,
                IsSystemJob = true
            });
#endif
        }
Example #2
0
        protected override void OnInitializeRunner()
        {
            //Acr.Logging.Log.ToDebug();

            //this.AddTestAssembly(typeof(Plugin.BluetoothLE.Tests.DeviceTests).GetTypeInfo().Assembly);
            UwpShinyHost.Init(new TestStartup());
            this.AddTestAssembly(this.GetType().GetTypeInfo().Assembly);
        }
Example #3
0
 public void Start()
 {
     // TODO: if push is enabled, start timer and check channel expiration
     // if push already registered, start it up automagically here
     //e.BadgeNotification
     //await this.serviceProvider.Resolve<IPushDelegate>()?.OnReceived(e.RawNotification.Content);
     //this.CurrentRegistrationToken = e.RawNotification.Ur
     //this.CurrentRegistrationTokenDate = DateTime.UtcNow;
     //e.Cancel = true;
     UwpShinyHost.RegisterBackground <PushNotificationBackgroundTaskProcessor>(
         builder => builder.SetTrigger(new PushNotificationTrigger())
         );
 }
Example #4
0
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
            var rootFrame = Window.Current.Content as Frame;

            if (rootFrame == null)
            {
                rootFrame = new Frame();
                rootFrame.NavigationFailed += this.OnNavigationFailed;
                Forms.Init(e);
                UwpShinyHost.Init(new SampleStartup());

                Window.Current.Content = rootFrame;
            }

            if (rootFrame.Content == null)
            {
                rootFrame.Navigate(typeof(MainPage), e.Arguments);
            }

            Window.Current.Activate();
        }
Example #5
0
 public App()
 {
     this.InitializeComponent();
     this.Suspending += this.OnSuspending;
     UwpShinyHost.Init(new ShinyStartup());
 }
Example #6
0
 public App()
 {
     this.InitializeComponent();
     //UwpShinyHost.ClearBackgroundTasks();
     UwpShinyHost.Init(new SampleStartup());
 }