Example #1
0
 public Agent(AppSecret secret, INotificationConsumer consumer, ITokenStore store, IAgentSettings agentSettings)
 {
     this.Secret       = secret;
     this.Consumer     = consumer;
     this.Store        = store;
     _agentSettings    = agentSettings;
     _retryWaitSeconds = agentSettings.InitialRetryWaitSeconds;
 }
Example #2
0
        public ApnsAgent(AppSecret secret, INotificationConsumer consumer, ITokenStore store)
            : base(secret, consumer, store, _settings)
        {
            _readBuffer = new byte[6];
            var feedbackInterval = Settings.Apns.FeedbackIntervalSeconds * 1000;

            _feedbackTimer = new Timer(OnQueryFeedback, null, feedbackInterval, feedbackInterval);
        }
 public NotificationEventArgs(INotificationConsumer consumer, string deviceToken, uint expiry, JObject payload, object tag)
 {
     _consumer        = consumer;
     _acked           = false;
     this.DeviceToken = deviceToken;
     this.Expiry      = expiry;
     this.Payload     = payload;
     this.Tag         = tag;
 }
 public void SubstrubeTo(INotificationConsumer consumer)
 {
     Xamarin.Forms.Device.StartTimer(TimeSpan.FromSeconds(2), () => {
         try {
             IEnumerable <NotificationEntity> notify = gateway.GetNotifications(consumer.Account.Id).Result;
             --count;
             DispatcherEx.BeginRise(() => consumer.OnNotificationsReceived(notify.Map <NotificationEntity, NotificationModel>()));
             if (count == 0)
             {
                 return(false);
             }
         } catch (Exception ex) {
             ex.ToString();
         }
         return(true);
     });
 }
Example #5
0
 public WnsAgent(AppSecret secret, INotificationConsumer consumer, ITokenStore store)
     : base(secret, consumer, store, _settings)
 {
 }
Example #6
0
 public NotificationConsumerWorker(INotificationConsumer notificationConsumer, IServiceScopeFactory scopeFactory)
 {
     _notificationConsumer = notificationConsumer;
     _scopeFactory         = scopeFactory;
 }