Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS Facebook Login but not Connect?

today I've an hard question that it causes me some problems.

I'm beginning to implement, for the first in my life, the Facebook Login/Connect in my iOS application.

What's strange? Nothing so far, except I want that the users can ONLY login in the app with Facebook Login, not signup. I explain better: only the users that are already registered in my website can use Facebook Login for logging in.

  • Website: users can signup with Facebook Connect
  • iOS app: users can use Facebook Connect only if they're already connected in the website with Facebook Connect.

Is it possible or is an illusion? For example if there's a way to get the facebook uuid of the logged user before show the permission popup it would be great, because I check for this uuid in my database and if exists I'll allow to connect the user.

like image 720
Fred Collins Avatar asked Jan 17 '23 11:01

Fred Collins


2 Answers

On the website side

Your user logs in, then authorizes to use your app. As soon as she is authorized, add her user id to your database.

On iOS side

Your user logs in. As soon as she logs in you have access to her user id. So, before showing the main app screen display a loading graphic. Send a request with the user id to your server. The server replies that she is authorized and you proceed to show your main app screen. OR, the server replies that she is not authorized and you proceed to show an error message that instructs the user to first authorize on the website (maybe this screen should have a retry button).

like image 169
Gil Birman Avatar answered Jan 24 '23 20:01

Gil Birman


if i get your question .. you can build an Api_service on your website through it you can send the user email from the application and check if this mail registered on your website .. so before the user login to Facebook you make a request to call this api > you returned a value to your app tell you that the user is registered in your site or not .. so then you can allow just the user's you want to login fb.

like image 34
Malek_Jundi Avatar answered Jan 24 '23 21:01

Malek_Jundi