Prechádzať zdrojové kódy

URLHandler: Dropbox: Handle cancel

Soomin Lee 5 rokov pred
rodič
commit
66f0047c03
1 zmenil súbory, kde vykonal 8 pridanie a 0 odobranie
  1. 8 0
      Sources/URLHandler.swift

+ 8 - 0
Sources/URLHandler.swift

@@ -34,6 +34,14 @@ import Foundation
 class DropBoxURLHandler: NSObject, VLCURLHandler {
 
     @objc func canHandleOpen(url: URL, options: [UIApplication.OpenURLOptionsKey: AnyObject]) -> Bool {
+
+        let components = url.pathComponents
+        let methodName = components.count > 1 ? components[1] : nil
+
+        if methodName == "cancel" {
+            return false
+        }
+
         return url.scheme == "db-a60fc6qj9zdg7bw"
     }