mirror of
https://github.com/status-im/react-native.git
synced 2025-01-14 11:34:23 +00:00
Clean up RCTWebSocketProxyDelegate a bit
Reviewed By: javache Differential Revision: D4296294 fbshipit-source-id: b31e522c21ec490fdf98711655e5e8df22b32a12
This commit is contained in:
parent
f0ca55aee8
commit
ac489858f8
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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"]];
|
||||
|
Loading…
x
Reference in New Issue
Block a user