public final class NetworkingModule extends ReactContextBaseJavaModule
NativeModule.NativeMethodMETHOD_TYPE_REMOTE, METHOD_TYPE_REMOTE_ASYNC| Constructor and Description |
|---|
NetworkingModule(ReactApplicationContext context) |
NetworkingModule(ReactApplicationContext reactContext,
com.squareup.okhttp.OkHttpClient client) |
NetworkingModule(ReactApplicationContext context,
java.lang.String defaultUserAgent) |
| Modifier and Type | Method and Description |
|---|---|
void |
abortRequest(int requestId) |
void |
clearCookies(Callback callback) |
java.lang.String |
getName() |
void |
initialize()
This is called at the end of
CatalystApplicationFragment#createCatalystInstance()
after the CatalystInstance has been created, in order to initialize NativeModules that require
the CatalystInstance or JS modules. |
void |
onCatalystInstanceDestroy()
Called before {CatalystInstance#onHostDestroy}
|
void |
sendRequest(java.lang.String method,
java.lang.String url,
int requestId,
ReadableArray headers,
ReadableMap data,
boolean useIncrementalUpdates,
int timeout) |
getCurrentActivity, getReactApplicationContextcanOverrideExistingModule, getConstants, getMethods, writeConstantsFieldpublic NetworkingModule(ReactApplicationContext context)
context - the ReactContext of the applicationpublic NetworkingModule(ReactApplicationContext context, java.lang.String defaultUserAgent)
context - the ReactContext of the applicationdefaultUserAgent - the User-Agent header that will be set for all requests where the
caller does not provide one explicitlypublic NetworkingModule(ReactApplicationContext reactContext, com.squareup.okhttp.OkHttpClient client)
public void initialize()
NativeModuleCatalystApplicationFragment#createCatalystInstance()
after the CatalystInstance has been created, in order to initialize NativeModules that require
the CatalystInstance or JS modules.initialize in interface NativeModuleinitialize in class BaseJavaModulepublic java.lang.String getName()
require() this module
from javascript.public void onCatalystInstanceDestroy()
NativeModuleonCatalystInstanceDestroy in interface NativeModuleonCatalystInstanceDestroy in class BaseJavaModulepublic void sendRequest(java.lang.String method,
java.lang.String url,
int requestId,
ReadableArray headers,
ReadableMap data,
boolean useIncrementalUpdates,
int timeout)
public void abortRequest(int requestId)
public void clearCookies(Callback callback)