简体   繁体   English

如何同步获取iOS中已连接用户的Facebook UID?

[英]How do I synchronously get the Facebook UID of the connected user in iOS?

I use iOS Facebook SDK 3.1. 我使用iOS Facebook SDK 3.1。 I am using FBSession's openActiveSessionWithReadPermissions:allowLoginUI:completionHandler: to connect the user to Facebook. 我正在使用FBSession的openActiveSessionWithReadPermissions:allowLoginUI:completionHandler:将用户连接到Facebook。 After the user is connected, is there way to synchronously get the logged in user's UID? 连接用户后,是否有办法同步获取已登录用户的UID? I am aware I can asynchronously get the UID with FBRequestConnection's startForMeWithCompletionHandler: , but the asynchronousness complicates my flow and the extra HTTP request seems wasted to get something as simple as the UID. 我知道我可以使用FBRequestConnection的startForMeWithCompletionHandler:异步获取UID,但是异步使我的流程复杂化,多余的HTTP请求似乎浪费了获取与UID一样简单的操作。

the asyncronousness complicates my flow 异步使我的流程复杂化

It's usually easier for the programmer to do things synchronously, but its usually better for the user to do things asynchronously. 对于程序员来说,同步执行通常比较容易 ,但是对于用户而言,异步执行通常会更好

the extra HTTP request seems wasted to get something as simple as the UID 多余的HTTP请求似乎浪费了一些像UID一样简单的东西

How long will that request take? 该请求将花费多长时间? 100 milliseconds? 100毫秒? 1 second? 1秒? 10 seconds? 10秒? Answer: you have no way of knowing how long it'll take, and it could easily be 10 seconds or more in some cases. 答:您无法知道需要多长时间,在某些情况下很容易会达到10秒或更长时间。 Do you really want to freeze your app for that long because you're too lazy to do things the right way? 您是否真的想冻结应用程序这么长时间,因为您懒得以正确的方式做事? What will your users think? 您的用户会怎么想? Do you care? 你关心?

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

相关问题 如何使用Facebook Graph API和facebook ios sdk获取完整的User对象? - How do I get the full User object using Facebook Graph API and facebook ios sdk? 如何在不提示用户获取Facebook权限的情况下在iOS应用中获取公共Facebook页面的源? - How do I get the feed of a public Facebook page in an iOS app without prompting the user for Facebook permissions? 如何从iOS SDK中的Facebook对象获取Facebook用户ID? - How do I get the Facebook user Id from the Facebook object in the iOS SDK? 新手IOS 5:如何让Facebook返回当前登录用户的“关于我”数据? - newbie IOS 5: How do I get Facebook to return “About Me” data on the currently logged in user? 如何使用用户名链接到iOS App中的Facebook用户? - How do I link to a Facebook user in the iOS App by using the username? iOS应用无法通过在FQL中调用me()获得Facebook uid - IOS app cannot get Facebook uid by calling me() in FQL 如何从连接的iOS设备获取电池充电周期? - How Do I get Battery Charge Cycles from a connected iOS device? iOS FIRAuth:有什么方法可以从用户uid获取用户电子邮件? - iOS FIRAuth : Is there any way to get user email from user uid? 如何使用特定用户的uid获取数据? - How to get data for a specific User using their uid? iOS开发和发行证书是否共享相同的用户ID(UID)? - Do iOS development and distribution certificates share the same user id (UID)?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM