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

Commit

Permalink
fix(iOS): Resolve exception thrown when using getAll
Browse files Browse the repository at this point in the history
* Remove unused getAll function

* Update getAll in README
  • Loading branch information
safaiyeh authored Dec 30, 2019
1 parent 4f97b07 commit d22dd7a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
15 changes: 0 additions & 15 deletions ios/RNCookieManagerIOS/RNCookieManagerIOS.m
Original file line number Diff line number Diff line change
Expand Up @@ -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<NSHTTPCookie *>*)cookies
{
NSMutableDictionary *cookieList = [NSMutableDictionary dictionary];
Expand Down

0 comments on commit d22dd7a

Please sign in to comment.