Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
xcuserdata/
xcshareddata/
.DS_Store

4 changes: 2 additions & 2 deletions CallbackURLKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MACOSX_DEPLOYMENT_TARGET = 10.14;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -502,7 +502,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MACOSX_DEPLOYMENT_TARGET = 10.14;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import PackageDescription

let package = Package(
name: "CallbackURLKit",
platforms: [.iOS(.v11), .macOS(.v10_14), .tvOS(.v10)],
platforms: [.iOS(.v9), .macOS(.v10_14), .tvOS(.v10)],
products: [
.library(name: "CallbackURLKit", targets: ["CallbackURLKit"])
],
Expand Down
26 changes: 23 additions & 3 deletions Sources/Manager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ open class Manager {

open var callbackURLScheme: String?

open var callbackQueue: DispatchQueue = .main
open var callbackQueue: DispatchQueue = .global(qos: .background) // .main

#if APP_EXTENSIONS
/// In case of application extension, put your extensionContext here
Expand Down Expand Up @@ -252,14 +252,34 @@ open class Manager {
extensionContext.open(url, completionHandler: extensionContextCompletionHandler)
} else {
#if os(iOS) || os(tvOS)
UIApplication.shared.open(url)
guard UIApplication.shared.canOpenURL(url) else {
return
}
if #available(iOS 10.0, tvOS 10.0, *) {
UIApplication.shared.open(url, options: [:]) { success in
_ = success
NSLog("open url \(success)")
}
} else {
UIApplication.shared.openURL(url)
}
#elseif os(OSX)
NSWorkspace.shared.open(url)
#endif
}
#else
#if os(iOS) || os(tvOS)
UIApplication.shared.open(url)
guard UIApplication.shared.canOpenURL(url) else {
return
}
if #available(iOS 10.0, tvOS 10.0, *) {
UIApplication.shared.open(url, options: [:]) { success in
_ = success
NSLog("open url \(success)")
}
} else {
UIApplication.shared.openURL(url)
}
#elseif os(OSX)
NSWorkspace.shared.open(url)
#endif
Expand Down