Skip to content

Support for alternative HTTP Clients #5568

Open
@yschimke

Description

@yschimke

What feature would you like to see?

CctTransportBackend.doSend() is hardcoded to use HttpURLConnection.

https://github.com/firebase/firebase-android-sdk/blob/master/transport/transport-backend-cct/src/main/java/com/google/android/datatransport/cct/CctTransportBackend.java

Ideally this would be easily configurable to share the HTTP Client with other parts of the app, such as image loaders, APIs (retrofit).

This is possible with URL.setURLStreamHandlerFactory to either Cronet or OkHttp (via ObsoleteUrlFactory)

While it seems possible to replace it via TransportBackendDiscovery in the manifest, it would duplicate a lot of code from CctTransportBackend.

How would you use it?

For Wear Apps, using OkHttp provides a centralised place to restrict requests when it isn't appropriate, such as avoiding using LTE and logging network traffic. OkHttp has event listeners and interceptors that allow such things.

Activity

google-oss-bot

google-oss-bot commented on Nov 22, 2023

@google-oss-bot
Contributor

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @yschimke@google-oss-bot@argzdev

        Issue actions

          Support for alternative HTTP Clients · Issue #5568 · firebase/firebase-android-sdk