diff --git a/src/ios/screenshot.m b/src/ios/screenshot.m index d4781ce..5337911 100644 --- a/src/ios/screenshot.m +++ b/src/ios/screenshot.m @@ -14,13 +14,13 @@ - (void)pluginInitialize usingBlock:^(NSNotification *note) { if ([self.webView respondsToSelector:@selector(stringByEvaluatingJavaScriptFromString:)]) { // UIWebView - [self.webView performSelectorOnMainThread:@selector(stringByEvaluatingJavaScriptFromString:) withObject:@"cordova.fireDocumentEvent('screenshot');" waitUntilDone:NO]; + [self.webView performSelectorOnMainThread:@selector(stringByEvaluatingJavaScriptFromString:) withObject:@"cordova.fireWindowEvent('screenshot');" waitUntilDone:NO]; } else if ([self.webView respondsToSelector:@selector(evaluateJavaScript:completionHandler:)]) { // WKWebView - [self.webView performSelector:@selector(evaluateJavaScript:completionHandler:) withObject:@"cordova.fireDocumentEvent('screenshot');" withObject:nil]; + [self.webView performSelector:@selector(evaluateJavaScript:completionHandler:) withObject:@"cordova.fireWindowEvent('screenshot');" withObject:nil]; } else { // cordova lib version is > 4 - [self.commandDelegate evalJs:@"cordova.fireDocumentEvent('screenshot');" ]; + [self.commandDelegate evalJs:@"cordova.fireWindowEvent('screenshot');" ]; } }]; }