Skip to content
This repository was archived by the owner on Jan 13, 2020. It is now read-only.

Commit d22dd7a

Browse files
authored
fix(iOS): Resolve exception thrown when using getAll
* Remove unused getAll function * Update getAll in README
1 parent 4f97b07 commit d22dd7a

File tree

2 files changed

+2
-16
lines changed

2 files changed

+2
-16
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ CookieManager.get('http://example.com')
111111
});
112112

113113
// list cookies (IOS ONLY)
114-
CookieManager.getAll()
114+
// useWebKit: boolean
115+
CookieManager.getAll(useWebKit)
115116
.then((res) => {
116117
console.log('CookieManager.getAll =>', res);
117118
});

ios/RNCookieManagerIOS/RNCookieManagerIOS.m

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -230,21 +230,6 @@ -(NSString *)getDomainName:(NSURL *) url
230230
}
231231
}
232232

233-
RCT_EXPORT_METHOD(getAll:(RCTPromiseResolveBlock)resolve
234-
rejecter:(RCTPromiseRejectBlock)reject) {
235-
NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
236-
NSMutableDictionary *cookies = [NSMutableDictionary dictionary];
237-
for (NSHTTPCookie *c in cookieStorage.cookies) {
238-
NSMutableDictionary *d = [NSMutableDictionary dictionary];
239-
[d setObject:c.value forKey:@"value"];
240-
[d setObject:c.name forKey:@"name"];
241-
[d setObject:c.domain forKey:@"domain"];
242-
[d setObject:c.path forKey:@"path"];
243-
[d setObject:[self.formatter stringFromDate:c.expiresDate] forKey:@"expiresDate"];
244-
[cookies setObject:d forKey:c.name];
245-
}
246-
}
247-
248233
-(NSDictionary *)createCookieList:(NSArray<NSHTTPCookie *>*)cookies
249234
{
250235
NSMutableDictionary *cookieList = [NSMutableDictionary dictionary];

0 commit comments

Comments
 (0)