简体   繁体   English

iOS Facebook登录但不连接?

[英]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. 我开始在我的生活中首次实现iOS应用程序中的Facebook登录/连接。

What's strange? 有什么奇怪的? Nothing so far, except I want that the users can ONLY login in the app with Facebook Login, not signup. 到目前为止没什么,除了我希望用户只能通过Facebook登录在应用程序中登录,而不是注册。 I explain better: only the users that are already registered in my website can use Facebook Login for logging in. 我解释得更好:只有已在我网站注册的用户才能使用Facebook登录进行登录。

  • Website: users can signup with Facebook Connect 网站:用户可以使用Facebook Connect注册
  • iOS app: users can use Facebook Connect only if they're already connected in the website with Facebook Connect. iOS应用程序:用户只有在Facebook Connect已连接到网站时才可以使用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. 例如,如果在显示权限弹出窗口之前有办法获取已记录用户的facebook uuid,那将会很棒,因为我在我的数据库中检查了这个uuid,如果存在,我将允许连接用户。

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. 获得授权后,立即将其用户ID添加到您的数据库中。

On iOS side 在iOS方面

Your user logs in. As soon as she logs in you have access to her user id. 您的用户登录。一旦登录,您就可以访问她的用户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). 或者,服务器回复说她没有被授权,你继续显示一条错误消息,指示用户首先在网站上进行授权(也许这个屏幕应该有一个重试按钮)。

如果我得到你的问题..你可以通过它在你的网站上建立一个Api_service你可以从应用程序发送用户的电子邮件,并检查这个邮件是否在你的网站上注册..所以在用户登录Facebook之前你请求打电话这个api>你给你的应用程序返回了一个值告诉你用户是否在你的网站上注册了..那么你就可以只允许用户登录fb了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM