Add a factory to choose default one Add to iOS demo app the `ASWebAuthentifcationURLHandler`
24 lines
575 B
Swift
24 lines
575 B
Swift
//
|
|
// ExtensionContextURLHandler.swift
|
|
// OAuthSwift
|
|
//
|
|
// Created by phimage on 01/11/2019.
|
|
// Copyright © 2019 Dongri Jin, Marchand Eric. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
/// Open url using `NSExtensionContext``
|
|
open class ExtensionContextURLHandler: OAuthSwiftURLHandlerType {
|
|
|
|
fileprivate var extensionContext: NSExtensionContext
|
|
|
|
public init(extensionContext: NSExtensionContext) {
|
|
self.extensionContext = extensionContext
|
|
}
|
|
|
|
@objc open func handle(_ url: URL) {
|
|
extensionContext.open(url, completionHandler: nil)
|
|
}
|
|
}
|