You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by jc...@apache.org on 2018/12/19 12:36:09 UTC

[cordova-plugin-wkwebview-engine] branch master updated: GH-68 (ios): Support for disabling 3D Touch link previews (#69)

This is an automated email from the ASF dual-hosted git repository.

jcesarmobile pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-plugin-wkwebview-engine.git


The following commit(s) were added to refs/heads/master by this push:
     new d0bd80a  GH-68 (ios): Support for disabling 3D Touch link previews (#69)
d0bd80a is described below

commit d0bd80a65bb0fd828bf70106c589d0448d8793d8
Author: nilsd <ni...@users.noreply.github.com>
AuthorDate: Wed Dec 19 13:36:02 2018 +0100

    GH-68 (ios): Support for disabling 3D Touch link previews (#69)
    
    * Support for disabling 3D Touch link previews
    
    * Update README.md
    
    Instructions on how to use preference Allow3DTouchLinkPreview
---
 README.md                    | 9 +++++++++
 src/ios/CDVWKWebViewEngine.m | 1 +
 2 files changed, 10 insertions(+)

diff --git a/README.md b/README.md
index 0bafd32..e6bf628 100644
--- a/README.md
+++ b/README.md
@@ -96,6 +96,15 @@ window.WkWebView.allowsBackForwardNavigationGestures(true)
 window.WkWebView.allowsBackForwardNavigationGestures(false)
 ```
 
+Disabling 3D Touch Link Previews
+-----------
+
+In order to disable preview popups when hard pressing links in iOS, you can set the following preference in your `config.xml`:
+
+```xml
+<preference name="Allow3DTouchLinkPreview" value="false" />
+```
+
 Limitations
 --------
 
diff --git a/src/ios/CDVWKWebViewEngine.m b/src/ios/CDVWKWebViewEngine.m
index e6778c8..b337548 100644
--- a/src/ios/CDVWKWebViewEngine.m
+++ b/src/ios/CDVWKWebViewEngine.m
@@ -283,6 +283,7 @@ static void * KVOContext = &KVOContext;
     }
 
     wkWebView.allowsBackForwardNavigationGestures = [settings cordovaBoolSettingForKey:@"AllowBackForwardNavigationGestures" defaultValue:NO];
+    wkWebView.allowsLinkPreview = [settings cordovaBoolSettingForKey:@"Allow3DTouchLinkPreview" defaultValue:YES];
 }
 
 - (void)updateWithInfo:(NSDictionary*)info


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org