marinofaggiana 5 年之前
父节点
当前提交
b04ffc6a16
共有 2 个文件被更改,包括 19 次插入0 次删除
  1. 7 0
      iOSClient/AppDelegate.m
  2. 12 0
      iOSClient/Viewer/NCViewerRichdocument.swift

+ 7 - 0
iOSClient/AppDelegate.m

@@ -34,6 +34,8 @@
 #import "NCAutoUpload.h"
 #import "NCAutoUpload.h"
 #import "NCPushNotificationEncryption.h"
 #import "NCPushNotificationEncryption.h"
 
 
+@class NCViewerRichdocument;
+
 @interface AppDelegate () <UNUserNotificationCenterDelegate, CCLoginDelegate, CCLoginDelegateWeb>
 @interface AppDelegate () <UNUserNotificationCenterDelegate, CCLoginDelegate, CCLoginDelegateWeb>
 {
 {
 PKPushRegistry *pushRegistry;
 PKPushRegistry *pushRegistry;
@@ -251,6 +253,11 @@ PKPushRegistry *pushRegistry;
     
     
     NSLog(@"[LOG] Required unsubscribing / subscribing");
     NSLog(@"[LOG] Required unsubscribing / subscribing");
     [self pushNotification];
     [self pushNotification];
+    
+    NSLog(@"[LOG] RichDocument");
+    if (self.activeDetail.richDocument) {
+        [self.activeDetail.richDocument grabFocus];
+    }
 }
 }
 
 
 //
 //

+ 12 - 0
iOSClient/Viewer/NCViewerRichdocument.swift

@@ -114,6 +114,18 @@ class NCViewerRichdocument: WKWebView, WKNavigationDelegate, WKScriptMessageHand
         }
         }
     }
     }
     
     
+    //MARK: -
+
+    @objc func grabFocus() {
+    
+        let functionJS = "OCA.RichDocuments.documentsMain.postGrabFocus()"
+        evaluateJavaScript(functionJS) { (result, error) in
+            let text = result as? String
+            print(text)
+        }
+
+    }
+    
     //MARK: -
     //MARK: -
     
     
     func dismissSelect(serverUrl: String?, metadata: tableMetadata?, type: String) {
     func dismissSelect(serverUrl: String?, metadata: tableMetadata?, type: String) {