美文网首页iOS TableView 优化
Swift 雅虎登录集成

Swift 雅虎登录集成

作者: 屈涯 | 来源:发表于2019-06-17 15:57 被阅读0次
          let manager = YConnectManager.sharedInstance()
          if #available(iOS 11.0, *) {
              manager?.requestAuthorization(withPrompt: "consent", handler: { (error) in
                  if error == nil {
                      manager?.fetchAccessToken(manager?.authorizationCode, handler: { (token, error) in
                          if error == nil {
                              manager?.fetchUserInfo(token?.accessToken, handler: { (userInfo, error) in
                                  if error == nil {
                                      print(userInfo?.gender)
                                      print(userInfo?.addressCountry)
                                  }
                              })
                          }
                      })
                  }
              })
          } else {
              // Fallback on earlier versions
              manager?.requestAuthorization(withPrompt: "consent", presenting: LoggedInResultViewController())
          }
    

    相关文章

      网友评论

        本文标题:Swift 雅虎登录集成

        本文链接:https://www.haomeiwen.com/subject/obvtwqtx.html