I am aiming to get a user's details based on his/her Twitter account. Now first of all, let me explain what I want to do.
In my case, user will be presented an option to Sign-up with Twitter account. So, based on user's Twitter account, I want to be able to get user details (e.g. email-id, name, profile picture, birth date, gender etc..) and save those details in database. Now, many people will probably suggest me to use ACAccount
and ACAccountStore
, a class that provides an interface for accessing, manipulating, and storing accounts. But in my case, I want to sign up user, even if user has not configured an account for Twitter in iOS Settings App. I want user to navigate to login screen of Twitter (in Safari or in App itself, or using any other alternative).
I have also referred the documentation of Twitter having API list here. But I am a lot confused how user should be presented a login screen to log into the Twitter account and how I will get profile information. Should I use UIWebView
, or redirect user to Safari or adopt another way for that ?
How to get email id in twitter ?
Step 1 : got to https://apps.twitter.com/app/
Step 2 : click on ur app > click on permission tab .
Step 3 : here check the email box
Twitter has provided a beautiful framework for that, you just have to integrate it in your app.
https://dev.twitter.com/twitter-kit/ios
It has a simple Login Method:-
This is the process to get user profile information:-
I think rest you can find from Twitter Kit Tutorial, it also allows to request a user’s email, by calling the TwitterAuthClient#requestEmail method, passing in a valid TwitterSession and Callback.
Finally, after having a long conversation with
sdk-feedback@twitter.com
, I got my App whitelisted. Here is the story:Send mail to
sdk-feedback@twitter.com
with some details about your App like Consumer key, App Store link of an App, Link to privacy policy, Metadata, Instructions on how to log into our App. Mention in mail that you want to access user email address inside your App.They will review your App and reply to you within 2-3 business days.
Once they say that your App is whitelisted, update your App's settings in Twitter Developer portal. Sign in to apps.twitter.com and:
Put your hands on code:
Agree with statement of Vizllx: "Twitter has provided a beautiful framework for that, you just have to integrate it in your app."
Get user email address
Get user profile
Hope it helps !!!
In Twitter you can get
user_name
anduser_id
only. It is that much secure that you can't fetchemail id
,birth date
,gender
etc.., compare to Facebook, Twitter is very confidential for supplying the data.need ref: link1.