Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android can't use custom OkHttpClient #15998

Closed
celesteshire opened this issue Sep 19, 2017 · 1 comment
Closed

Android can't use custom OkHttpClient #15998

celesteshire opened this issue Sep 19, 2017 · 1 comment
Labels
Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@celesteshire
Copy link

celesteshire commented Sep 19, 2017

Is this a bug report?

(Yes)

Have you read the Contributing Guidelines?

(No)

Environment

  1. react-native -v: 2.0.1
  2. node -v: v8.4.0
  3. npm -v: 5.3.0

Then, specify:

  • Target Platform: Android
  • Development Operating System: macOS
  • Build tools: Android Studio

Steps to Reproduce

(Write your steps here:)

use OkHttpClientProvider.replaceOkHttpClient(customClient);

Expected Behavior

Can use customClient

Actual Behavior

Every time you re-create a new one internally OkHttpClient

Because the following code causes the problem(this is NetworkingModule.java):

public NetworkingModule(final ReactApplicationContext context) {
    this(context, null, OkHttpClientProvider.createClient(), null);
}

Every time it's new

but

image

Will not be used to the customClient

@stale
Copy link

stale bot commented Nov 18, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Nov 18, 2017
@stale stale bot closed this as completed Nov 25, 2017
@facebook facebook locked and limited conversation to collaborators May 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

1 participant