Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Classes/Network/PonyDebugger/FLEXNetworkObserver.m
Original file line number Diff line number Diff line change
Expand Up @@ -1591,15 +1591,19 @@ typedef void (^SendMessageBlock)(
[FLEXNetworkObserver.sharedObserver
websocketTask:slf sendMessagage:message
];
completion = ^(NSError *error) {

id completionHook = ^(NSError *error) {
[FLEXNetworkObserver.sharedObserver
websocketTaskMessageSendCompletion:message
error:error
];
if (completion) {
completion(error);
}
};

((void(*)(id, SEL, id, id))objc_msgSend)(
slf, swizzledSelector, message, completion
slf, swizzledSelector, message, completionHook
);
};

Expand Down
4 changes: 3 additions & 1 deletion Example/FLEXample/MiscNetworkRequests.m
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ - (void)sendExampleNetworkRequests:(NSURLSession *)sessionWithDelegate {
}

- (void)sendExampleWebsocketTraffic:(NSURLSession *)sessionWithDelegate {
NSString *APIKey = @"oCdCMcMPQpbvNjUIzqtvF1d2X2okWpDQj4AwARJuAgtjhzKxVEjQU6IdCjwm";
NSString *APIKey = @"VCXCEuvhGcBDP7XhiJJUDvR1e1D3eiVjgZ9VRiaV";
NSString *wsurl = [NSString stringWithFormat:@"wss://demo.piesocket.com/v3/channel_1?api_key=%@&notify_self", APIKey];
NSURLSessionWebSocketTask *task = [sessionWithDelegate webSocketTaskWithURL:[NSURL URLWithString:wsurl]];
[task resume];
Expand All @@ -167,6 +167,8 @@ - (void)URLSession:(NSURLSession *)session webSocketTask:(NSURLSessionWebSocketT
[task sendMessage:message completionHandler:^(NSError *error) {
if (error) {
NSLog(@"Error sending WS message: %@", error.localizedDescription);
} else {
NSLog(@"WS message sent.");
}
}];
}
Expand Down