Skip to content

Instantly share code, notes, and snippets.

@Doko-Demo-Doa
Created September 21, 2020 18:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Doko-Demo-Doa/bb00605a2bb4f75d0cdf5a4f5be5aedc to your computer and use it in GitHub Desktop.
Save Doko-Demo-Doa/bb00605a2bb4f75d0cdf5a4f5be5aedc to your computer and use it in GitHub Desktop.
package com.yourapp;
import com.facebook.react.modules.network.OkHttpClientFactory;
import com.facebook.react.modules.network.ReactCookieJarContainer;
import okhttp3.OkHttpClient;
public class CustomNetworkModule implements OkHttpClientFactory {
@Override
public OkHttpClient createNewNetworkModuleClient() {
return new OkHttpClient.Builder()
.dns(new CustomDNS())
.cookieJar(new ReactCookieJarContainer())
.build();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment