1

Here is my code to auth with Instagram using safariviewcontroller. Everything is okay, but web page in SFVC is too big, why?

    func doOAuthInstagram(_ serviceParameters: [String:String]){
        let oauthswift = OAuth2Swift(
            consumerKey:    serviceParameters["consumerKey"]!,
            consumerSecret: serviceParameters["consumerSecret"]!,
            authorizeUrl:   "https://api.instagram.com/oauth/authorize",
            responseType:   "code"
        )

        oauthswift.allowMissingStateCheck = true
        oauthswift.authorizeURLHandler = SafariURLHandler(viewController: self, oauthSwift: oauthswift)

        guard let rwURL = URL(string: "https://badyi.github.io/") else { return }

        oauthswift.authorize(withCallbackURL: rwURL, scope: "user_profile,user_media", state: "1"){ result in
                   switch result {
                   case .success(let (credential, _, _)):
                       self.showTokenAlert(name: serviceParameters["name"], credential: credential)
                   case .failure(let error):
                       print(error.description)
                   }
        }
    }

Result

enter image description here

Thanks in advance.

B25Dec
  • 2,301
  • 5
  • 31
  • 54
badyi badyi
  • 11
  • 1
  • 5

0 Answers0