firebase / firebase-admin-dotnet

Firebase Admin .NET SDK
https://firebase.google.com/docs/admin/setup
Apache License 2.0
370 stars 131 forks source link

Feature Request: Add support for HTTP/2 #356

Open TommyN opened 1 year ago

TommyN commented 1 year ago

Modifying the FirebaseMessaingClient.SendAsync and adding new Version(2, 0) should allow HTTP/2 to be used.

  ...
  var request = new HttpRequestMessage()
  {
    Version = new Version(2, 0),
    Method = HttpMethod.Post,
    RequestUri = new Uri(this.sendUrl),
    Content = NewtonsoftJsonSerializer.Instance.CreateJsonHttpContent(body),
  };

Users of this library would probably also want to configure the EnableMultipleHttp2Connections property, but as far as I can gather this requires changes in the Google.Apis.Core and requires >= .NET 5

google-oss-bot commented 1 year ago

I found a few problems with this issue:

ewfian commented 1 year ago

Related: https://github.com/firebase/firebase-admin-dotnet/issues/349#issuecomment-1647384948

JensSchadron commented 5 months ago

@lahirumaramba Any news on this? Because of the deprecation of the FCM batch API endpoint (in 15 days from now) and the HTTP V1 API relying mostly on HTTP/2 multiplexing to achieve greater throughput, this seems like a pretty important thing to look into.

nbevans commented 1 month ago

This could be solved if we could supply a custom HttpMessageHandler to the underlying HttpClient, it would solve the issue. Is that possible? Can it be made possible?

Because then you could reference the System.Net.Http.WinHttpHandler nuget which provides HTTP2 on older .NET Framework runtimes, and also provide a suitable workaround for many other scenarios.