[GH-ISSUE #436] How to get notified SafariViewController has been dismissed #283

Closed
opened 2026-03-03 16:47:22 +03:00 by kerem · 3 comments
Owner

Originally created by @shaibt on GitHub (Feb 13, 2018).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/436

Description:

Hi,
How do I get notified the user hit "done" on the SF View Controller and never followed through (accept or deny) on the auth process?
I see that SafariURLHandler implements safariViewControllerDidFinish delegate function (which is used to cancel pending observers) but the auth process isn't failed nor is the finished event exposed to the OAuth2Swift object that initiated the flow.
I require this in order to present a specific UI when the user neither accepts or denies the auth request.

OAuth Provider (Twitter, Github, ..):

OAuth Version:

  • Version 1
  • Version 2

OS (Please fill the version) :

  • iOS :
  • OSX :
  • TVOS :
  • WatchOS :

Installation method:

  • Carthage
  • CocoaPods
  • Manually

Library version:

  • head
  • v1.2 (Swift 4.0)
  • v1.0.0
  • v0.6
  • other: (Please fill in the version you are using.)

Xcode version:

  • 9.0 (Swift 4.0)

  • 9.0 (Swift 3.2)

  • 8.x (Swift 3.x)

  • 8.0 (Swift 2.3)

  • 7.3.1

  • other: (Please fill in the version you are using.)

  • objective c

Originally created by @shaibt on GitHub (Feb 13, 2018). Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/436 ### Description: Hi, How do I get notified the user hit "done" on the SF View Controller and never followed through (accept or deny) on the auth process? I see that `SafariURLHandler` implements `safariViewControllerDidFinish` delegate function (which is used to cancel pending observers) but the auth process isn't failed nor is the finished event exposed to the `OAuth2Swift` object that initiated the flow. I require this in order to present a specific UI when the user neither accepts or denies the auth request. ### OAuth Provider (Twitter, Github, ..): ### OAuth Version: - [ ] Version 1 - [x] Version 2 ### OS (Please fill the version) : - [x] iOS : - [ ] OSX : - [ ] TVOS : - [ ] WatchOS : ### Installation method: - [ ] Carthage - [x] CocoaPods - [ ] Manually ### Library version: - [ ] head - [x] v1.2 (Swift 4.0) - [ ] v1.0.0 - [ ] v0.6 - [ ] other: (Please fill in the version you are using.) ### Xcode version: - [x] 9.0 (Swift 4.0) - [ ] 9.0 (Swift 3.2) - [ ] 8.x (Swift 3.x) - [ ] 8.0 (Swift 2.3) - [ ] 7.3.1 - [ ] other: (Please fill in the version you are using.) - [ ] objective c
kerem closed this issue 2026-03-03 16:47:23 +03:00
Author
Owner

@phimage commented on GitHub (Feb 13, 2018):

you can set a delegate to the SafariURLHandler and implement safariViewControllerDidFinish

<!-- gh-comment-id:365260809 --> @phimage commented on GitHub (Feb 13, 2018): you can set a delegate to the `SafariURLHandler` and implement `safariViewControllerDidFinish`
Author
Owner

@shaibt commented on GitHub (Feb 13, 2018):

Oops. Missed that. Thanks for the quick reply!

<!-- gh-comment-id:365296713 --> @shaibt commented on GitHub (Feb 13, 2018): Oops. Missed that. Thanks for the quick reply!
Author
Owner

@shaibt commented on GitHub (Feb 13, 2018):

Works. Thanks again. Maybe worth mentioning in the docs.

<!-- gh-comment-id:365381577 --> @shaibt commented on GitHub (Feb 13, 2018): Works. Thanks again. Maybe worth mentioning in the docs.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/OAuthSwift#283
No description provided.