Hi there.
I have this code block for custom twitter login button:
@IBAction func twitter(_ sender: Any) {
Twitter.sharedInstance().logIn(withMethods: [.webBased]) { session, error in
if (session != nil) {
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
let json = JSON(data: data!);
print(json);
}
} else {
print( error?.localizedDescription );
}
}
}
First question is what is currently login type (withMethods) parameters. Like, webBased.
Example, can I use .appBased or etc?
2 - print(json); looks pretty good, but I still need the email address. How can I get it?
Thank you!