Exemplo n.º 1
0
        public FcmHttpClient(IFcmClientSettings settings, IJsonSerializer serializer, Google.Apis.Http.IHttpClientFactory httpClientFactory, CreateHttpClientArgs httpClientArgs)
        {
            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }

            if (serializer == null)
            {
                throw new ArgumentNullException(nameof(serializer));
            }

            this.settings   = settings;
            this.client     = httpClientFactory.CreateHttpClient(httpClientArgs);
            this.serializer = serializer;
            this.credential = CreateServiceAccountCredential(httpClientFactory, settings);

            InitializeExponentialBackOff(client, settings);
        }
Exemplo n.º 2
0
 public FcmHttpClient(IFcmClientSettings settings, Google.Apis.Http.IHttpClientFactory httpClientFactory, CreateHttpClientArgs httpClientArgs)
     : this(settings, JsonSerializer.Default, httpClientFactory, httpClientArgs)
 {
 }