Skip to content

Commit a68466c

Browse files
authored
🐛 Fix building on iOS 8, 9, and 10 (#29)
1 parent 546b5c1 commit a68466c

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

ios/Classes/SwiftFlutterWebAuthPlugin.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,12 @@ public class SwiftFlutterWebAuthPlugin: NSObject, FlutterPlugin {
5353

5454
session.start()
5555
sessionToKeepAlive = session
56-
} else {
56+
} else if #available(iOS 11, *) {
5757
let session = SFAuthenticationSession(url: url, callbackURLScheme: callbackURLScheme, completionHandler: completionHandler)
5858
session.start()
5959
sessionToKeepAlive = session
60+
} else {
61+
result(FlutterError(code: "FAILED", message: "This plugin does currently not support iOS lower than iOS 11" , details: nil))
6062
}
6163
} else if (call.method == "cleanUpDanglingCalls") {
6264
// we do not keep track of old callbacks on iOS, so nothing to do here

ios/flutter_web_auth.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ A new flutter plugin project.
1616
s.public_header_files = 'Classes/**/*.h'
1717
s.dependency 'Flutter'
1818

19-
s.ios.deployment_target = '11.0'
19+
s.ios.deployment_target = '8.0'
2020
s.swift_version = '5.0'
2121
end

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
A Flutter plugin for authenticating a user with a web service, even if the web service is run by a third party. Most commonly used with OAuth2, but can be used with any web flow that can redirect to a custom scheme.
44

5-
In the background, this plugin uses [`ASWebAuthenticationSession`][ASWebAuthenticationSession] on iOS 12+ and macOS 10.15+, [`SFAuthenticationSession`][SFAuthenticationSession] on iOS 11, and [Chrome Custom Tabs][Chrome Custom Tabs] on Android.
5+
In the background, this plugin uses [`ASWebAuthenticationSession`][ASWebAuthenticationSession] on iOS 12+ and macOS 10.15+, [`SFAuthenticationSession`][SFAuthenticationSession] on iOS 11, and [Chrome Custom Tabs][Chrome Custom Tabs] on Android. You can build it with iOS 8+, but it is currently only supported by iOS 11 or higher.
66

77
[ASWebAuthenticationSession]: https://developer.apple.com/documentation/authenticationservices/aswebauthenticationsession
88
[SFAuthenticationSession]: https://developer.apple.com/documentation/safariservices/sfauthenticationsession

0 commit comments

Comments
 (0)