mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-03-26 07:04:05 +08:00
Support cookies on Android
Summary: This adds a persistent cookie store that shares cookies with WebView. Add a `ForwardingCookieHandler` to OkHttp that uses the underlying Android webkit `CookieManager`. Use a `LazyCookieHandler` to defer initialization of `CookieManager` as this will in turn trigger initialization of the Chromium stack in KitKat+ which takes some time. This was we will incur this cost on a background network thread instead of during startup. Also add a `clearCookies()` method to the network module. Add a cookies example to the XHR example. This example should also work for iOS (except for the clear cookies part). They are for now just scoped to Android. Closes #2792. public Reviewed By: andreicoman11 Differential Revision: D2615550 fb-gh-sync-id: ff726a35f0fc3c7124d2f755448fe24c9d1caf21
This commit is contained in:
committed by
facebook-github-bot-6
parent
f57c2a9140
commit
274c5c78c4
@@ -40,6 +40,10 @@ class RCTNetworking {
|
||||
static abortRequest(requestId) {
|
||||
RCTNetworkingNative.abortRequest(requestId);
|
||||
}
|
||||
|
||||
static clearCookies(callback) {
|
||||
RCTNetworkingNative.clearCookies(callback);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = RCTNetworking;
|
||||
|
||||
Reference in New Issue
Block a user