mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 14:53:25 +01:00
Fixes Patreon login screen not appearing on iOS 13
This commit is contained in:
@@ -71,7 +71,7 @@ extension PatreonAPI
|
||||
}
|
||||
}
|
||||
|
||||
class PatreonAPI
|
||||
class PatreonAPI: NSObject
|
||||
{
|
||||
static let shared = PatreonAPI()
|
||||
|
||||
@@ -84,8 +84,9 @@ class PatreonAPI
|
||||
private let session = URLSession(configuration: .ephemeral)
|
||||
private let baseURL = URL(string: "https://www.patreon.com/")!
|
||||
|
||||
private init()
|
||||
private override init()
|
||||
{
|
||||
super.init()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,6 +130,11 @@ extension PatreonAPI
|
||||
}
|
||||
}
|
||||
|
||||
if #available(iOS 13.0, *)
|
||||
{
|
||||
self.authenticationSession?.presentationContextProvider = self
|
||||
}
|
||||
|
||||
self.authenticationSession?.start()
|
||||
}
|
||||
|
||||
@@ -384,3 +390,12 @@ private extension PatreonAPI
|
||||
task.resume()
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 13.0, *)
|
||||
extension PatreonAPI: ASWebAuthenticationPresentationContextProviding
|
||||
{
|
||||
func presentationAnchor(for session: ASWebAuthenticationSession) -> ASPresentationAnchor
|
||||
{
|
||||
return UIApplication.shared.keyWindow ?? UIWindow()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user