[GH-ISSUE #366] help please i have to use a Handle authorize URL in a UIWebView, WKWebView but with SafariURLHandler not function on code 8.3.2 #233

Closed
opened 2026-03-03 16:46:54 +03:00 by kerem · 4 comments
Owner

Originally created by @oshitub123 on GitHub (Apr 26, 2017).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/366

Description:

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.0.0
  • v0.6
  • other: (Please fill in the version you are using.)

Xcode version:

  • 8.0 (Swift 3.0)

  • 8.0 (Swift 2.3)

  • 7.3.1

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

  • objective c

Originally created by @oshitub123 on GitHub (Apr 26, 2017). Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/366 ### Description: ### 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.0.0 - [ ] v0.6 - [ ] other: (Please fill in the version you are using.) ### Xcode version: - [x] 8.0 (Swift 3.0) - [ ] 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:46:54 +03:00
Author
Owner

@phimage commented on GitHub (Apr 26, 2017):

No information, log or error
Title too long

Invalide issue - close

Show the other issue...

<!-- gh-comment-id:297460391 --> @phimage commented on GitHub (Apr 26, 2017): No information, log or error Title too long Invalide issue - close Show the other issue...
Author
Owner

@oshitub123 commented on GitHub (Apr 26, 2017):

2017-04-25 12:05:03.680 pruebaslibrary[7476:136239] Warning: Attempt to present <SFSafariViewController: 0x7fdf8ef02960> on <pruebaslibrary.ViewController: 0x7fdf8ef07420> whose view is not in the window hierarchy!

<!-- gh-comment-id:297461516 --> @oshitub123 commented on GitHub (Apr 26, 2017): 2017-04-25 12:05:03.680 pruebaslibrary[7476:136239] Warning: Attempt to present <SFSafariViewController: 0x7fdf8ef02960> on <pruebaslibrary.ViewController: 0x7fdf8ef07420> whose view is not in the window hierarchy!
Author
Owner

@oshitub123 commented on GitHub (Apr 26, 2017):

i need to embebed the url for to use correctly your library but dont function the safariviewcontroller only i have the previous error

// code

import UIKit
import OAuthSwift
import SafariServices
class ViewController: UIViewController,UIApplicationDelegate,SFSafariViewControllerDelegate
{

override func viewDidLoad() {
    super.viewDidLoad()
    
            let oauthswift = OAuth2Swift(
    
    
                consumerKey:    "*****************",//IMPLICIT
                consumerSecret: "",
                authorizeUrl:   "https://api.instagram.com/oauth/authorize/?",
                accessTokenUrl: "http://www.example/oauth/token",
                responseType:   "token"
    
    
            )
    
            let safari = SafariURLHandler(viewController: self,oauthSwift:oauthswift)
            safari.delegate = self as! SFSafariViewControllerDelegate
           oauthswift.authorizeURLHandler = safari
    
    
    
             oauthswift.authorize(
                withCallbackURL: URL(string: "http://www.example.com/")!,
                scope: "", state:"",
    
                success: { credential, response, parameters in
                    
                    print(credential.oauthToken)
            },
                failure: { error in
                    print(error.localizedDescription)
            }
            )
}}
<!-- gh-comment-id:297461787 --> @oshitub123 commented on GitHub (Apr 26, 2017): i need to embebed the url for to use correctly your library but dont function the safariviewcontroller only i have the previous error // code import UIKit import OAuthSwift import SafariServices class ViewController: UIViewController,UIApplicationDelegate,SFSafariViewControllerDelegate { override func viewDidLoad() { super.viewDidLoad() let oauthswift = OAuth2Swift( consumerKey: "*****************",//IMPLICIT consumerSecret: "", authorizeUrl: "https://api.instagram.com/oauth/authorize/?", accessTokenUrl: "http://www.example/oauth/token", responseType: "token" ) let safari = SafariURLHandler(viewController: self,oauthSwift:oauthswift) safari.delegate = self as! SFSafariViewControllerDelegate oauthswift.authorizeURLHandler = safari oauthswift.authorize( withCallbackURL: URL(string: "http://www.example.com/")!, scope: "", state:"", success: { credential, response, parameters in print(credential.oauthToken) }, failure: { error in print(error.localizedDescription) } ) }}
Author
Owner

@phimage commented on GitHub (Apr 26, 2017):

... edit your message
And
I have already answered

<!-- gh-comment-id:297462674 --> @phimage commented on GitHub (Apr 26, 2017): ... edit your message And I have already answered
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#233
No description provided.