Explorar o código

URLHandler: Dropbox: Handle cancel

Soomin Lee %!s(int64=5) %!d(string=hai) anos
pai
achega
66f0047c03
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  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"
     }