diff --git a/README.md b/README.md index 2bbfb5c..cecee07 100644 --- a/README.md +++ b/README.md @@ -111,7 +111,8 @@ CookieManager.get('http://example.com') }); // list cookies (IOS ONLY) -CookieManager.getAll() +// useWebKit: boolean +CookieManager.getAll(useWebKit) .then((res) => { console.log('CookieManager.getAll =>', res); }); diff --git a/ios/RNCookieManagerIOS/RNCookieManagerIOS.m b/ios/RNCookieManagerIOS/RNCookieManagerIOS.m index 47609f6..b1fcee5 100644 --- a/ios/RNCookieManagerIOS/RNCookieManagerIOS.m +++ b/ios/RNCookieManagerIOS/RNCookieManagerIOS.m @@ -230,21 +230,6 @@ -(NSString *)getDomainName:(NSURL *) url } } -RCT_EXPORT_METHOD(getAll:(RCTPromiseResolveBlock)resolve - rejecter:(RCTPromiseRejectBlock)reject) { - NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage]; - NSMutableDictionary *cookies = [NSMutableDictionary dictionary]; - for (NSHTTPCookie *c in cookieStorage.cookies) { - NSMutableDictionary *d = [NSMutableDictionary dictionary]; - [d setObject:c.value forKey:@"value"]; - [d setObject:c.name forKey:@"name"]; - [d setObject:c.domain forKey:@"domain"]; - [d setObject:c.path forKey:@"path"]; - [d setObject:[self.formatter stringFromDate:c.expiresDate] forKey:@"expiresDate"]; - [cookies setObject:d forKey:c.name]; - } -} - -(NSDictionary *)createCookieList:(NSArray*)cookies { NSMutableDictionary *cookieList = [NSMutableDictionary dictionary];