Hello,
I have been using fabric to build twitter login, everything goes fine except i am missing the email that i need. I do however get the email on my android version of the app we build. The app is whitelisted and all and it works on android so i am unsure what i am doing wrong here.
I am using the following piece of code.
let logInButton = TWTRLogInButton { (session, error) in
if session != nil {
print("signed in as \(session!.userName)");
let client = TWTRAPIClient.clientWithCurrentUser()
let request = client.URLRequestWithMethod("GET",
URL: "https://api.twitter.com/1.1/account/verify_credentials.json?include_email=true",
parameters: ["include_email": "true", "skip_status": "true"],
error: nil)
client.sendTwitterRequest(request) { response, data, connectionError in
if (connectionError == nil) {
let json : AnyObject
do{
json = try NSJSONSerialization.JSONObjectWithData(data!, options: [])
print("Json response: ", json)
let firstName = json["name"]
let lastName = json["screen_name"]
let email = "-"
print("First name: ",firstName)
print("Last name: ",lastName)
print("Email: ",email)
} catch {
}
}
else {
print("Error: \(connectionError)")
}
}
} else {
NSLog("Login error: %@", error!.localizedDescription);
}
}
the json response just isn’t showing the email, everything else is there.
What should i do?