Skip to content

Commit

Permalink
Dev: add support swift6 for Android
Browse files Browse the repository at this point in the history
  • Loading branch information
andriydruk committed Jan 20, 2025
1 parent d3d050f commit 2d103d3
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 5 deletions.
5 changes: 4 additions & 1 deletion Sources/Handler/ExtensionContextURLHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ open class ExtensionContextURLHandler: OAuthSwiftURLHandlerType {
self.extensionContext = extensionContext
}

@objc open func handle(_ url: URL) {
#if _runtime(_ObjC)
@objc
#endif
open func handle(_ url: URL) {
extensionContext.open(url, completionHandler: nil)
}
}
5 changes: 4 additions & 1 deletion Sources/Handler/OAuthSwiftOpenURLExternally.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ open class OAuthSwiftOpenURLExternally: OAuthSwiftURLHandlerType {

public static var sharedInstance: OAuthSwiftOpenURLExternally = OAuthSwiftOpenURLExternally()

@objc open func handle(_ url: URL) {
#if _runtime(_ObjC)
@objc
#endif
open func handle(_ url: URL) {
#if os(iOS) || os(tvOS)
#if !OAUTH_APP_EXTENSIONS
if #available(iOS 10.0, *) {
Expand Down
5 changes: 4 additions & 1 deletion Sources/OAuthSwiftClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ import FoundationNetworking

public var OAuthSwiftDataEncoding: String.Encoding = .utf8

@objc public protocol OAuthSwiftRequestHandle {
#if _runtime(_ObjC)
@objc
#endif
public protocol OAuthSwiftRequestHandle {
func cancel()
}

Expand Down
5 changes: 4 additions & 1 deletion Sources/OAuthSwiftHTTPRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ open class OAuthSwiftHTTPRequest: NSObject, OAuthSwiftRequestHandle {
}

/// Where the additional parameters will be injected
@objc public enum ParamsLocation: Int {
#if _runtime(_ObjC)
@objc
#endif
public enum ParamsLocation: Int {
case authorizationHeader, /*FormEncodedBody,*/ requestURIQuery
}

Expand Down
2 changes: 2 additions & 0 deletions Sources/OAuthSwiftResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ import FoundationNetworking
#endif

/// Response object
#if _runtime(_ObjC)
@objc
#endif
public class OAuthSwiftResponse: NSObject { // not a struct for objc
/// The data returned by the server.
public var data: Data
Expand Down
5 changes: 4 additions & 1 deletion Sources/OAuthSwiftURLHandlerType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ import AppKit

/// Protocol to defined how to open the url.
/// You could choose to open using an external browser, a safari controller, an internal webkit view controller, etc...
@objc public protocol OAuthSwiftURLHandlerType {
#if _runtime(_ObjC)
@objc
#endif
public protocol OAuthSwiftURLHandlerType {
func handle(_ url: URL)
}

Expand Down

0 comments on commit 2d103d3

Please sign in to comment.