diff --git a/src/ios/CDVSocketPlugin.m b/src/ios/CDVSocketPlugin.m index 1dd6e72..4335dac 100644 --- a/src/ios/CDVSocketPlugin.m +++ b/src/ios/CDVSocketPlugin.m @@ -345,7 +345,14 @@ - (void) sendMessage :(NSString *)host :(int)port :(NSString *)chunk { NSString *receiveHook = [NSString stringWithFormat : @"window.tlantic.plugins.socket.receive('%@', %d, '%@', '%@' );", host, port, [self buildKey : host : port], [NSString stringWithString : data]]; - [self writeJavascript:receiveHook]; + [self.webViewEngine evaluateJavaScript:receiveHook completionHandler:^(id result, NSError *anError) { + if (anError) { + NSLog(@"ERROR: Failed to execute the receive hook for CDVSocketPlugin: %@", [anError localizedDescription]); + } else { + NSLog(@"Receive hook JS code returned with: %@", result); + } + + }]; } -@end \ No newline at end of file +@end