Beispiel #1
0
        private void StartAgent(IUnityContainer container, Platform platform, AppSecret secret)
        {
            Agent agent;

            var secretParam = new ParameterOverride("secret", secret);

            switch (platform)
            {
            case Platform.Apns:
                agent = container.Resolve <ApnsAgent>(secretParam);
                break;

            case Platform.Mpns:
                agent = container.Resolve <MpnsAgent>(secretParam);
                break;

            case Platform.Gcm:
                agent = container.Resolve <GcmAgent>(secretParam);
                break;

            case Platform.Wns:
                agent = container.Resolve <WnsAgent>(secretParam);
                break;

            default:
                return;
            }

            _agents.Add(agent);
            agent.Start();
        }
Beispiel #2
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;
 }
Beispiel #3
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);
        }
Beispiel #4
0
 public WnsAgent(AppSecret secret, INotificationConsumer consumer, ITokenStore store)
     : base(secret, consumer, store, _settings)
 {
 }