Restructuring FBReactKit project: Part 1

This commit is contained in:
Nick Lockwood
2015-06-25 01:59:17 -07:00
parent 1109ce3b8c
commit 648c2b48c2
3 changed files with 6 additions and 3 deletions

View File

@@ -7,8 +7,6 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import <AdSupport/ASIdentifierManager.h>
#import "RCTBridgeModule.h"
@interface RCTAdSupport : NSObject <RCTBridgeModule>

View File

@@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import <AdSupport/ASIdentifierManager.h>
#import "RCTAdSupport.h"
@implementation RCTAdSupport

View File

@@ -285,7 +285,7 @@ RCT_EXPORT_MODULE()
}];
id<RCTURLRequestHandler> handler = [handlers lastObject];
if (!handler) {
RCTLogError(@"No suitable request handler found for %@", request);
RCTLogError(@"No suitable request handler found for %@", request.URL);
}
return handler;
}
@@ -322,6 +322,9 @@ RCT_EXPORT_MODULE()
NSURLRequest *request = [RCTConvert NSURLRequest:query[@"uri"]];
if (request) {
id<RCTURLRequestHandler> handler = [self handlerForRequest:request];
if (!handler) {
return;
}
(void)[[RCTDataLoader alloc] initWithRequest:request handler:handler callback:^(NSData *data, NSString *MIMEType, NSError *error) {
if (data) {
callback(nil, @{@"body": data, @"contentType": MIMEType});