Facebook iOS SDK:登录到Facebook而不总是要求应用程序的权限 [英] Facebook iOS SDK: Login to Facebook without always ask for permissions for the application

查看:186
本文介绍了Facebook iOS SDK:登录到Facebook而不总是要求应用程序的权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的应用程序中使用Facebook iOS SDK,我有两个类似的问题:

I'm using the Facebook iOS SDK in my application and i have two similar question:


  1. 有没有办法知道是否或者没有用户当前登录?

  2. 我现在使用的是在成功登录时存储访问令牌和到期日期,并在应用程序启动时加载它们。我的问题是:如果会话无效,我是否可以让用户选择登录而不每次都要求权限?因为现在,每次我想登录时都会收到我已经给我的应用授予权限的消息。而且我只想在没有这部分的情况下登录。

  1. Is there any way to know whether or not there is a user currently logged in?
  2. What i'm using now is storing the access token and expiration date on successful login, and load them when the application start. My question is: If the session is not valid, can i just give the user the option to log in without asking every time for permissions? because right now, every time that i want to login i get the message that i already gave permissions to my app. And I only want to login without this part.

任何想法?

推荐答案


  1. graph.facebook.com/me 的调用只会在您有效的情况下返回结果身份验证令牌。如果没有访问令牌,您也不会登录。

  2. 请求 offline_access 权限或者不要使用新的登录机制但是登录对话框。该对话框将弹出您的应用程序,只询问一次权限。

  1. A call to graph.facebook.com/me will return results only in case you have valid auth token. Without an access token you are not logged in, too.
  2. Either request offline_access privilege or just do not use the new login mechanism but a login dialog. The dialog will popover your app and only ask once for privileges.

我目前在iPhone上,因此无法提供代码,在SDK中寻找FBDialog方法。

I'm currently on iPhone, so can not provide code, but have look for the FBDialog methods in SDK.

这篇关于Facebook iOS SDK:登录到Facebook而不总是要求应用程序的权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆