사용하여 트위터에서 이메일을 얻으려고 노력 무기 호 :스위프트 3 : 내가 트위터에서 사용자의 이메일을이 문을 사용하고 직물
I tested this code and it returns a nil for the email address! ` let client = TWTRAPIClient.withCurrentUser()
let request = client.urlRequest(withMethod: "GET",
url: "https://api.twitter.com/1.1/account/verify_credentials.json",
parameters: ["include_email": "true", "skip_status": "true"],
error: nil)
client.sendTwitterRequest(request) { response, data, connectionError in
if (connectionError == nil) {
do{
let json = try JSONSerialization.jsonObject(with: data!, options: .allowFragments) as! [String:Any]
print("Json response: ", json)
let firstName = json["name"]
let lastName = json["screen_name"]
let email = json["email"]
print("First name: ",firstName!)
print("Last name: ",lastName!)
print("Email: ",email!)
} catch {
}
}
else {
print("Error: \(connectionError)")
}
}
`
그러나 불행하게도이 전무 반환!
나는 이미 내 앱을 화이트리스트에 올렸고 트위터 팀으로부터 모든 권한이 내 앱에 부여되었다는 이메일을 받았다.
응답에서 emailID를 반환하는 Twitter API 중지. –