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())
}
网友评论