Example #1
0
 public CalendarController(
     IMapper mapper,
     ICalendarService calendarService,
     ICalendarValidator calendarValidator,
     NotificationHubManager notificationHubManager,
     CalendarHubManager calendarHubManager)
 {
     _mapper              = mapper;
     _calendarService     = calendarService;
     _calendarValidator   = calendarValidator;
     _notificationManager = notificationHubManager;
     _calendarManager     = calendarHubManager;
 }
Example #2
0
 public EventController(
     IEventService eventService,
     ICalendarService calendarService,
     IInvitationService invitationService,
     NotificationHubManager notificationHubManager,
     InvitationHubManager invitationHubManager,
     IMapper mapper)
 {
     _eventService        = eventService;
     _calendarService     = calendarService;
     _invitationService   = invitationService;
     _notificationManager = notificationHubManager;
     _invitationManager   = invitationHubManager;
     _mapper = mapper;
 }
Example #3
0
        /// <summary>
        /// OnCreate
        /// </summary>
        /// <param name="bundle">Bundle</param>
        protected override void OnCreate(Bundle bundle)
        {
            MainActivity.TabLayoutResource = Resource.Layout.Tabbar;
            MainActivity.ToolbarResource   = Resource.Layout.Toolbar;

            // プッシュ通知初期化
            var notificationHubManager = NotificationHubManager.GetInstance();
            var notification           = new Services.Implements.Notification(Constant.Push.NotificationHubName, Constant.Push.ListenConnectionString, this);

            notificationHubManager.SetNotificationHub(notification);

            base.OnCreate(bundle);

            global::Xamarin.Forms.Forms.Init(this, bundle);
            this.LoadApplication(new App(new AndroidInitializer()));
        }
Example #4
0
        /// <summary>
        /// This method is invoked when the application has loaded and is ready to run. In this
        /// method you should instantiate the window, load the UI into it and then make the window
        /// visible.
        /// You have 17 seconds to return from this method, or iOS will terminate your application.
        /// </summary>
        /// <param name="app">UIApplication</param>
        /// <param name="options">NSDictionary</param>
        /// <returns>base.FinishedLaunching</returns>
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            global::Xamarin.Forms.Forms.Init();

            // プッシュ通知初期化
            var notificationHubManager = NotificationHubManager.GetInstance();
            var notification           = new Services.Implements.Notification(Constant.Push.ListenConnectionString, Constant.Push.NotificationHubName);

            notificationHubManager.SetNotificationHub(notification);

            if (UIDevice.CurrentDevice.CheckSystemVersion(10, 0))
            {
                UNUserNotificationCenter.Current.RequestAuthorization(
                    UNAuthorizationOptions.Alert | UNAuthorizationOptions.Sound | UNAuthorizationOptions.Sound,
                    (granted, error) =>
                {
                    if (granted)
                    {
                        InvokeOnMainThread(UIApplication.SharedApplication.RegisterForRemoteNotifications);
                    }
                });
            }
            else if (UIDevice.CurrentDevice.CheckSystemVersion(8, 0))
            {
                var pushSettings = UIUserNotificationSettings.GetSettingsForTypes(
                    UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound,
                    new NSSet());

                UIApplication.SharedApplication.RegisterUserNotificationSettings(pushSettings);
                UIApplication.SharedApplication.RegisterForRemoteNotifications();
            }
            else
            {
                UIRemoteNotificationType notificationTypes = UIRemoteNotificationType.Alert | UIRemoteNotificationType.Badge | UIRemoteNotificationType.Sound;
                UIApplication.SharedApplication.RegisterForRemoteNotificationTypes(notificationTypes);
            }

            this.LoadApplication(new App(new iOSInitializer()));

            return(base.FinishedLaunching(app, options));
        }
 public InvitationHub(IEventService eventService, IMapper mapper, NotificationHubManager notificationHubManager)
 {
     _eventService        = eventService;
     _mapper              = mapper;
     _notificationManager = notificationHubManager;
 }
 public void SetUp()
 {
     this.authHelper             = new Mock <IAuthHelper>();
     this.notificationHubManager = NotificationHubManager.GetInstance();
 }
 public void SetUp()
 {
     this.notificationHubManager = NotificationHubManager.GetInstance();
     this.notificationHub        = new Mock <INotificationHub>();
 }