Пример #1
0
 public FirebasePushNotificationService(IOptions <PushNotificationServiceOptions> pushOptions,
                                        IHttpClientFactory httpClientFactory,
                                        ILogger <FirebasePushNotificationService> logger)
 {
     _options           = pushOptions.Value;
     _logger            = logger;
     _httpClientFactory = httpClientFactory;
 }
Пример #2
0
        public PushServicePushNotificationService(IOptions <PushNotificationServiceOptions> optionsAccessor, IVapidTokenCache vapidTokenCache, ILogger <PushServicePushNotificationService> logger)
        {
            _options = optionsAccessor.Value;

            _pushClient = new PushServiceClient {
                DefaultAuthentication = new VapidAuthentication(_options.PublicKey, _options.PrivateKey)
                {
                    Subject    = _options.Subject,
                    TokenCache = vapidTokenCache
                }
            };

            _logger = logger;
        }