Skip to content

HTTP 2 in FCM

Jonathan Edey edited this page Jun 9, 2026 · 2 revisions

HTTP Agent

Currently, the SDK does not support setting a http.Agent on a HTTP/2 Connection and as a result http.Agent is ignored when sending FCM messages using the HTTP/2 transport layer.

Using Legacy HTTP/1.1

In the event of issues with the new HTTP/2 transport layer, developers can fall back to the legacy HTTP/1.1 logic by using the enableLegacyHttpTransport() method. This method, although marked deprecated, is intended to remain until the HTTP/2 transport implementation reaches the same stability as the legacy HTTP/1.1 implementation.

const messaging = getMessaging(app);
messaging.enableLegacyHttpTransport();
messaging.sendEach(messages);

Clone this wiki locally