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 }
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); }
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()) ); }
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(); }
public App() { this.InitializeComponent(); this.Suspending += this.OnSuspending; UwpShinyHost.Init(new ShinyStartup()); }
public App() { this.InitializeComponent(); //UwpShinyHost.ClearBackgroundTasks(); UwpShinyHost.Init(new SampleStartup()); }