Skip to content

Commit

Permalink
fix(iOS): restore cookie handling for iOS <= 10 (#1728)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobmllr95 committed Jan 13, 2021
1 parent 816c4a4 commit d338cae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apple/RNCWebView.m
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ - (void)didMoveToWindow
_webView.scrollView.scrollEnabled = _scrollEnabled;
_webView.scrollView.pagingEnabled = _pagingEnabled;
//For UIRefreshControl to work correctly, the bounces should always be true
_webView.scrollView.bounces = _pullToRefreshEnabled || _bounces;
_webView.scrollView.bounces = _pullToRefreshEnabled || _bounces;
_webView.scrollView.showsHorizontalScrollIndicator = _showsHorizontalScrollIndicator;
_webView.scrollView.showsVerticalScrollIndicator = _showsVerticalScrollIndicator;
_webView.scrollView.directionalLockEnabled = _directionalLockEnabled;
Expand Down Expand Up @@ -1155,7 +1155,7 @@ - (void)pullToRefresh:(UIRefreshControl *)refreshControl
- (void)setPullToRefreshEnabled:(BOOL)pullToRefreshEnabled
{
_pullToRefreshEnabled = pullToRefreshEnabled;

if (pullToRefreshEnabled) {
[self addPullToRefreshControl];
} else {
Expand Down Expand Up @@ -1356,7 +1356,7 @@ - (NSURLRequest *)requestForSource:(id)json {
if (_sharedCookiesEnabled) {
if (@available(iOS 11.0, *)) {
// see WKWebView initialization for added cookies
} else {
} else if (request != nil) {
NSArray *cookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookiesForURL:request.URL];
NSDictionary<NSString *, NSString *> *cookieHeader = [NSHTTPCookie requestHeaderFieldsWithCookies:cookies];
NSMutableURLRequest *mutableRequest = [request mutableCopy];
Expand Down

0 comments on commit d338cae

Please sign in to comment.