[ReactNative] Add RCTBridgeDelegate

Summary:
Add a new bridge delegate protocol to allow a more flexible bridge configuration.

For now it just support the pre-existent configurations + providing the JavaScript
source to the bridge, that should allow pre-loading sources.
This commit is contained in:
Tadeu Zagallo
2015-07-28 15:48:46 -07:00
parent 068f396c9b
commit 127f7095dc
9 changed files with 167 additions and 72 deletions

View File

@@ -149,7 +149,11 @@ RCT_EXPORT_MODULE()
- (void)executeApplicationScript:(NSString *)script sourceURL:(NSURL *)URL onComplete:(RCTJavaScriptCompleteBlock)onComplete
{
NSDictionary *message = @{@"method": @"executeApplicationScript", @"url": [URL absoluteString], @"inject": _injectedObjects};
NSDictionary *message = @{
@"method": @"executeApplicationScript",
@"url": RCTNullIfNil([URL absoluteString]),
@"inject": _injectedObjects,
};
[self sendMessage:message waitForReply:^(NSError *error, NSDictionary *reply) {
onComplete(error);
}];