Adds stetho interceptor to the OSS react native networking module

Reviewed By: mkonicek

Differential Revision: D2669416

fb-gh-sync-id: d061711a412348b16ffb877e0178a05460fd95f2
This commit is contained in:
Saurabh Aggarwal 2015-11-20 08:56:15 -08:00 committed by facebook-github-bot-0
parent 205a35ad37
commit a7c4ed106b
2 changed files with 4 additions and 0 deletions

View File

@ -248,6 +248,8 @@ dependencies {
compile 'com.android.support:recyclerview-v7:23.0.1'
compile 'com.facebook.fresco:fresco:0.8.1'
compile 'com.facebook.fresco:imagepipeline-okhttp:0.8.1'
compile 'com.facebook.stetho:stetho:1.2.0'
compile 'com.facebook.stetho:stetho-okhttp:1.2.0'
compile 'com.fasterxml.jackson.core:jackson-core:2.2.3'
compile 'com.google.code.findbugs:jsr305:3.0.0'
compile 'com.squareup.okhttp:okhttp:2.5.0'

View File

@ -25,6 +25,7 @@ import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.WritableArray;
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.modules.core.DeviceEventManagerModule;
import com.facebook.stetho.okhttp.StethoInterceptor;
import com.squareup.okhttp.Callback;
import com.squareup.okhttp.Headers;
@ -65,6 +66,7 @@ public final class NetworkingModule extends ReactContextBaseJavaModule {
OkHttpClient client) {
super(reactContext);
mClient = client;
mClient.networkInterceptors().add(new StethoInterceptor());
mShuttingDown = false;
mDefaultUserAgent = defaultUserAgent;
}