Present ExternalUserAgent without passing UIViewController for iOS
Nobody has claimed this yet.
- Dominant language
- Objective-C
- Stars
- 2k
- Forks
- 867
- Avg merge
- 4d 48m
- Merged PRs (30d)
- 1
Description
Hi @WilliamDenniss
@iainmcgin and I work in the same technology group and he encourages me to contribute.
While I was working on integrating our iOS SDK with AppAuth, I struggled asking our developers to pass UIViewController in order to sign in.
I understand that devices below iOS 11 require a UIViewController to present SafariViewController, however, an API that depends on UI code seems to violate the concept of clean architecture. I ended up minimizing the problem by marking iOS version with attribute
@available(iOS, deprecated: 11, message: "use signIn()")
public func signIn(from viewController: UIViewController) {}
@available(iOS 11, *)
public func signIn() {
signIn(from: UIViewController(nibName: nil, bundle: nil))
}
This solve my immediate problem because the apps we're going to support will soon stop supporting iOS 10. But this also makes me wonder if SFAuthenticationSession on iOS 11 and ASWebAuthenticationSession on iOS 12 simply just present their web views on the top most view controller, maybe it is not such a bad idea to do the same for iOS 9 and 10 for the sake of consistency and cleanness.
Please let me know how you think.
Thanks
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the existing signIn(from:) and signIn() entry points described in the issue, along with the iOS 9–12 authentication presentation behavior. Done would require a maintainer-approved API design for presenting authentication without a caller-supplied UIViewController and agreement on the supported iOS versions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, objective-c, swift
- Domain
- api, authentication, mobile-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100