chuck icon indicating copy to clipboard operation
chuck copied to clipboard

Someone can create a react native plugin for that?

Open ebellumat opened this issue 5 years ago • 6 comments

Someone can create a react native plugin for that?

ebellumat avatar Jun 01 '19 15:06 ebellumat

Someone can create a react native plugin for that?

Yes~ That's very useful i'm trying to add it to rn-fetch-blob for android projects, but it not work.

XingtianXin avatar Oct 28 '19 07:10 XingtianXin

did you guys found anything?

blikenoother avatar May 27 '20 18:05 blikenoother

I Will create the bridge, guys.

ebellumat avatar May 28 '20 17:05 ebellumat

After adding chuck plugin to your build.gradle. Go to your MainApplication.java's onCreate or Constructor and add following line :

OkHttpClientProvider.setOkHttpClientFactory(new CustomNetworkModule(this));

Also create following class, either in separate file or in the MainApplication.java only.

class CustomNetworkModule implements OkHttpClientFactory { private Context context;

public CustomNetworkModule(Context context) {
    this.context = context;
}

public OkHttpClient createNewNetworkModuleClient() {
    OkHttpClient client = new OkHttpClient.Builder()
            .addInterceptor(new ChuckInterceptor(this.context))
            .cookieJar(new ReactCookieJarContainer())
            .build();
    return client;
}

}

and start your activity : startActivity(Chuck.getLaunchIntent(this)); from MainActivity.java's onCreate.

Imports to refer :

import com.facebook.react.modules.network.OkHttpClientFactory; import com.facebook.react.modules.network.OkHttpClientProvider; import com.facebook.react.modules.network.ReactCookieJarContainer; import com.readystatesoftware.chuck.ChuckInterceptor; import okhttp3.OkHttpClient; import com.readystatesoftware.chuck.Chuck;

cp-rf avatar Sep 23 '20 11:09 cp-rf

Hi @cp-rf , This project is not maintained. You can try one of these forks

  1. Chucker - chuck + supports debug logs ..etc
  2. Gander - lean version of chuck

Ashok-Varma avatar Oct 19 '20 04:10 Ashok-Varma

anyone can implement this?

falihnaufal17 avatar Jul 27 '22 03:07 falihnaufal17