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

Commit

Permalink
Merge pull request #5 from Shopify/master
Browse files Browse the repository at this point in the history
Fix module loading
  • Loading branch information
joeferraro committed Aug 9, 2015
2 parents 8bdf140 + b2bfba1 commit 27f052d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
18 changes: 9 additions & 9 deletions RNCookieManagerIOS/RNCookieManagerIOS.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ @implementation RNCookieManagerIOS
RCT_EXPORT_MODULE()

RCT_EXPORT_METHOD(set:(NSDictionary *)props callback:(RCTResponseSenderBlock)callback) {
NSString *name = [RCTConvert NSString:props[@"name"]];
NSString *value = [RCTConvert NSString:props[@"value"]];
NSString *domain = [RCTConvert NSString:props[@"domain"]];
NSString *origin = [RCTConvert NSString:props[@"origin"]];
NSString *path = [RCTConvert NSString:props[@"path"]];
NSString *version = [RCTConvert NSString:props[@"version"]];
NSDate *expiration = [RCTConvert NSDate:props[@"expiration"]];
NSString *name = [RCTConvert NSString:props[@"name"]];
NSString *value = [RCTConvert NSString:props[@"value"]];
NSString *domain = [RCTConvert NSString:props[@"domain"]];
NSString *origin = [RCTConvert NSString:props[@"origin"]];
NSString *path = [RCTConvert NSString:props[@"path"]];
NSString *version = [RCTConvert NSString:props[@"version"]];
NSDate *expiration = [RCTConvert NSDate:props[@"expiration"]];

NSMutableDictionary *cookieProperties = [NSMutableDictionary dictionary];
[cookieProperties setObject:name forKey:NSHTTPCookieName];
Expand Down Expand Up @@ -40,7 +40,7 @@ @implementation RNCookieManagerIOS
RCT_EXPORT_METHOD(clearAll:(RCTResponseSenderBlock)callback) {
NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
for (NSHTTPCookie *c in cookieStorage.cookies) {
[cookieStorage deleteCookie:c];
[cookieStorage deleteCookie:c];
}
callback(@[[NSNull null], @"success"]);
}
Expand All @@ -60,4 +60,4 @@ @implementation RNCookieManagerIOS
callback(@[cookies, @"success"]);
}

@end
@end
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var NativeModules = require('NativeModules');
var NativeModules = require('react-native').NativeModules;
var invariant = require('invariant');
var RNCookieManagerIOS = NativeModules.RNCookieManagerIOS;

Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@
"description": "Cookie manager for react native",
"main": "index.js",
"author": "@joeferraro",
"license": "MIT"
"license": "MIT",
"dependencies": {
"invariant": "^2.1.0"
}
}

0 comments on commit 27f052d

Please sign in to comment.