Skip to content

Commit

Permalink
Quick Fix for iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroOrozco committed Mar 17, 2017
1 parent 24e7bf6 commit 2a8ca8b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ios/screenshot.m
Original file line number Diff line number Diff line change
Expand Up @@ -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');" ];
}
}];
}
Expand Down

0 comments on commit 2a8ca8b

Please sign in to comment.