Closed HyunjoonKo closed 2 years ago
Thanks for using TwitterAPIKit!
I tried "GET account/verify_credentials" and was able to get the email.
Here is the code.
let client = TwitterAPIClient(
consumerKey: "my-key",
consumerSecret: "my-secret",
oauthToken: "my-token",
oauthTokenSecret: "my-token-secret"
)
let response = await client.v1.account
.getAccountVerify(.init(skipStatus: true, includeEmail: true, includeEntities: false))
.responseObject
print(response.prettyString)
Perhaps this step may not be necessary. I forgot my token and had to regenerate it.
getAccountVerify(.init(skipStatus: true, includeEmail: true, includeEntities: false))
I was able to run the code and verify that the response contained the email.
Since you are already using TwitterKit, your application is probably already configured in the Developer Portal, but please double check.
And could you double check that the account you are using has the email set up and verified? The API documentation says that if verification is not complete, null will be returned.
https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/get-account-verify_credentials If the user does not have an email address on their account, or if the email address is not verified, null will be returned.
Hi @mironal
Thank you for answer.
There was a problem with the settings in the Twitter Developer Dashboard. It wasn't a library issue😅
Hi. I was originally using TwitterKit, but I'm going to switch to this library. But I ran into a problem implementing it.
I want to get the account email through v1 getAccountVerify, but the function does not work. Can you help? My implementation code looks like this:
On TwitterKit I was able to get the
email
value by calling include_email true in the same /1.1/account/verify_credentials.json. But I can't get it from this library.