cordova-plugin-3dtouch
cordova-plugin-3dtouch copied to clipboard
Need help with .disableLinkPreview()
Hello,
I'm trying to use .disableLinkPreview
to avoid the preview popup to be shown when the user press a "button" inside my app.
I'm using links (<a>
) as buttons in our navigation bar and the toolbar, so it doesn't look good that the user presses the "button" and a preview popup appears. Eventhough I call the .disableLinkPreview()
as soon as the page loads, the preview popup keeps appearing in all the links of the app.
Am I understanding correctly that disableLinkPreview()
will avoid this preview popup to appear? or I'm misunderstanding its use?
I'm attaching a picture of what preview popup I'm referring to.
cordova-plugin-3dtouch version: ~1.3.5 ios version: 10.3.2
Probably the issue is at line 44 of ThreeDeeTouch.m.
UIWebView is deprecated, and new cordova versions use WKWebView. So statement like this is never run if you are using WKWebView:
if ([self.webView class] == [UIWebView class])
You have to add a new if statement in the function disableLinkPreview , for example:
if ([self.webView class] == [WKWebView class]) {
WKWebView *w = (WKWebView*)self.webView;
w.allowsLinkPreview = NO;
}
and at the top of the file import WKWebView.
#import "CDVWKWebViewEngine.h"
The same issue is in enableLinkPreview().
It makes sense, I haven't tried yet but I'll try to setup a small project in the weekend to try it out