iPhone 上的 Facebook Connect 问题
当您在 iPhone 上使用 facebook connect 时,是否必须使用框架中内置的提供的登录按钮和登录屏幕?我问这个问题的原因是因为我也在使用 Twitter,并且我希望他们在登录用户时拥有与登录 Facebook 时相同的用户体验。因此,我可以复制 facebook connect 用于 twitter 的登录屏幕,或者只是不一起使用 facebook connect 登录屏幕。
When you use facebook connect on the iPhone do you have to use the supplied login button and login screen built into the framework? The reason I ask is because I'm also using twitter and I would like to have the same user experience when they log in to user as they have when they log in to facebook. So I can either replicate the login screen facebook connect uses for twitter or just not use the facebook connect login screen all together.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
登录按钮:无。登录屏幕:是的。我将 FB Connect 集成添加到 iPhone 版 FriendFeed 应用程序 Stir 中,并跳过了登录按钮。相反,用户可以选择 UIActionSheet 上的“在 Facebook 上共享”按钮,应用程序会显示登录屏幕或自动发布链接,具体取决于用户是否经过身份验证。
这是给您的代码片段。如果会话成功恢复,则将调用 FBSession 对象的委托上的方法。
抱歉,我上面的例子有点含糊。老实说,我发现 FBConnect 有点神秘,并尽力在我的应用程序中实现它并尽快摆脱它。如果您需要更多信息,请告诉我,我将给出更具体的答案。
根据以下请求:
您可以使用
FBSession
的+sessionForApplication:secret:delegate
类方法获取FBSession
对象。您对会话对象调用-resume
。如果它返回YES
,它将立即调用委托的-session:didLogin:
方法,您应该在其中放置依赖于 FB 的操作。如果它没有成功-resume
,那么您需要创建一个FBLoginDialog
,如上面的代码片段所示。有道理吗?如果您需要更多信息,请告诉我Login button: no. Login screen: yes. I added FB Connect integration to my FriendFeed app for iPhone, Stir, and skipped the login button. Instead, a user can choose a "Share on Facebook" button on a UIActionSheet and the app either displays a login screen or automatically posts a link depending on whether the user is authenticated.
Here's a code snippet for you. If the session is successfully resumed, then a method on your FBSession object's delegate will be called.
Apologies for being a little vague in my example above. To be honest, I find FBConnect to be a bit of a mystery and tried my best to implement it and get away from it as quickly as possible in my app. Let me know if you need more information and I'll put together a more-concrete answer.
Per the request below:
You can get an
FBSession
object withFBSession
's+sessionForApplication:secret:delegate
class method. You call-resume
on the session object. If it returnsYES
, it'll immediately call your delegate's-session:didLogin:
method, which is where you should put your FB-dependent actions. If it does not successfully-resume
, then you need to create anFBLoginDialog
, as seen in the code snippet above. Make sense? Let me know if you need more info