Marino Faggiana 6 年之前
父節點
當前提交
affcc332e5
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      iOSClient/Richdocument/NCRichdocument.swift

+ 6 - 1
iOSClient/Richdocument/NCRichdocument.swift

@@ -59,7 +59,12 @@ class NCRichdocument: NSObject, WKNavigationDelegate, WKScriptMessageHandler {
     }
     
     public func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) {
-        print("WKScriptMessage");
+        
+        if (message.name == "RichDocumentsMobileInterface") {
+            if message.body as! String == "close" {
+                print("\(message.body)")
+            }
+        }
     }
     
     public func webView(_ webView: WKWebView, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) {