public FcmServiceConnection(FcmConfiguration configuration) { Configuration = configuration; http = new HttpClient(); http.DefaultRequestHeaders.UserAgent.Clear(); http.DefaultRequestHeaders.UserAgent.Add(new ProductInfoHeaderValue("PushSharp", "3.0")); http.DefaultRequestHeaders.TryAddWithoutValidation("Authorization", "key=" + Configuration.SenderAuthToken); }
public FcmServiceConnection(FcmConfiguration configuration) { Configuration = configuration; if (null != configuration.Proxy) { var httpHandler = new HttpClientHandler { Proxy = configuration.Proxy }; http = new HttpClient(httpHandler, true); } else { http = new HttpClient(); } http.DefaultRequestHeaders.UserAgent.Clear(); http.DefaultRequestHeaders.UserAgent.Add(new ProductInfoHeaderValue("PushSharp", "3.0")); http.DefaultRequestHeaders.TryAddWithoutValidation("Authorization", "key=" + Configuration.SenderAuthToken); }
public FcmServiceBroker(FcmConfiguration configuration) : base(new FcmServiceConnectionFactory(configuration)) { }
public FcmServiceConnectionFactory(FcmConfiguration configuration) { Configuration = configuration; }