I am working with the webservies for ios and android app and need to develop a service for login with social media.
The app need to support login with twitter, facebook, linkedin, and google plus.
As parameters, I am accepting userid from social site and the site from which this id originated and the basic user info like firstname, lastname, and email.
Below is the structure of relevant tables for this
user table
userid | email | deviceid | firstname | lastname | password
userid being primary and email is unique
user social media table
userid | site | token
When I get this information from the frontend, I first check if social user id is already there. If social id doesn't match then I check if email exists in db or not. If email is not in the db, then I register the new user.
Now the main issue is that the twitter sdk for android and ios does not return the email and even facebook does not return the email if the user is registered by phone, because of this I am having a problem uniquely identifying the user on my end. I have searched a lot but can't come up with any solution for this.
Please correct me if I am wrong anywhere in my approach and suggest to me how can I handle the email issue.