Clean up RCTWebSocketProxyDelegate a bit

Reviewed By: javache

Differential Revision: D4296294

fbshipit-source-id: b31e522c21ec490fdf98711655e5e8df22b32a12
This commit is contained in:
Adam Ernst 2016-12-08 07:28:08 -08:00 committed by Facebook Github Bot
parent f0ca55aee8
commit ac489858f8
3 changed files with 3 additions and 3 deletions

View File

@ -66,7 +66,7 @@
NSDictionary<NSString *, id> *msg = RCTJSONParse(message, &error);
if (!error) {
[_delegate socketProxy:[RCTWebSocketManager sharedInstance] didReceiveMessage:msg];
[_delegate didReceiveWebSocketMessage:msg];
} else {
RCTLogError(@"WebSocketManager failed to parse message with error %@\n<message>\n%@\n</message>", error, message);
}

View File

@ -14,7 +14,7 @@
@protocol RCTWebSocketProxy;
@protocol RCTWebSocketProxyDelegate
- (void)socketProxy:(id<RCTWebSocketProxy>)sender didReceiveMessage:(NSDictionary<NSString *, id> *)message;
- (void)didReceiveWebSocketMessage:(NSDictionary<NSString *, id> *)message;
@end
#endif

View File

@ -281,7 +281,7 @@ RCT_EXPORT_MODULE()
return [kSupportedVersions containsObject:version];
}
- (void)socketProxy:(__unused id<RCTWebSocketProxy>)sender didReceiveMessage:(NSDictionary<NSString *, id> *)message
- (void)didReceiveWebSocketMessage:(NSDictionary<NSString *, id> *)message
{
if ([self isSupportedVersion:message[@"version"]]) {
[self processTarget:message[@"target"] action:message[@"action"] options:message[@"options"]];