Search code examples
facebookios6twitterfacebook-ios-sdk

Sign Up with Facebook and Twitter SDK for iOS


I am trying to add Facebook and Twitter login and sign up in my iOS app. As my App is server based, I need to create a user profile on my DataBase as well. But the problem is that I cannot fetch passwords from Facebook and Twitter for obvious reasons. So I am not sure how to go about it. What should be used as a password for the new profiles that are created, and then log the users in as well.

What have people done in past to create profiles on their databases by fetching information from Facebook and Twitter?

I want to save the Email address, Name, Location, Interests, and then also a password. What should be the right way of going about it?


Solution

  • You can't access that information of course. The way it works is Facebook or Twitter sending you a response saying "Yes, credentials are OK for user XXXXXX" Or "No, bad credentials". Then you can save the user's ID to your database.

    You will never get any other info unless you ask for permissions.

    https://developers.facebook.com/docs/concepts/login/

    https://dev.twitter.com/docs/auth/sign-twitter

    To ask permissions, you will have to create an app.

    How to ask for permission in facebook application?