jjzjj

currentAccessToken

全部标签

ios - "[[FBSDKAccessToken currentAccessToken] hasGranted:@"publish_actions "]"总是返回 false

我正在尝试验证我是否拥有publish_actions权限。总是假的。即使当我请求并获得publish_actions并获得succeeded=TRUE时,重新验证仍然返回false。有什么想法吗?boolbGranted_publish_actions=[[FBSDKAccessTokencurrentAccessToken]hasGranted:@"publish_actions"];boolbGranted_user_photos=[[FBSDKAccessTokencurrentAccessToken]hasGranted:@"user_photos"];if(!bGrante

ios - FBSDKAccessToken currentAccessToken 为 nil

代码:self.accountStore=[[ACAccountStorealloc]init];ACAccountType*FBaccountType=[self.accountStoreaccountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];NSString*appID=@"356775877779749";//TheappIDissuedbyFacebookNSDictionary*dictFB=[NSDictionarydictionaryWithObjectsAndKeys:appID,ACF

ios - 在 Facebook iOS SDK v4.0 中对应用程序启动时的事件 session 进行可靠检查

我正在使用FacebookiOSSDK4.0创建一个iOS应用程序,使用带有FBSDKLoginButtonView类的简单Facebook登录对话框。在上一次成功登录后启动应用程序时,按钮正确显示为“已登录”状态,即显示文本“注销”。但是,[FBSDKAccessTokencurrentAccessToken]为nil,这就是为什么我的应用程序不知道事件session,因此不会用数据填充与FB相关的字段。由于FBSession类在FBiOSSDK4.0中已经不存在了,如何才能正确判断是否存在缓存的session呢?我假设[FBSDKAccessTokencurrentAccessTo

ios - FBSDKAccessToken currentAccessToken 退出app后为nil

我正在开发一个使用FacebookSDK登录的ios应用程序。我已将LogInViewController设置为Storyboard中的初始ViewController,用户可从此处使用FB帐户登录。我有另一个ViewController,它会在用户登录后正确加载。在AppDelegate文件中,我正在检查currentAccessToken,如果它不是nil,我将直接加载第二个ViewController,因为用户已经登录。但是,如果我退出应用程序并重新启动它,currentAccessToken始终为nil。仅当我按下主页按钮并在应用程序仍在后台运行时重新打开它时它才有效。以下是代

ios - FBSDKAccessToken currentAccessToken 退出app后为nil

我正在开发一个使用FacebookSDK登录的ios应用程序。我已将LogInViewController设置为Storyboard中的初始ViewController,用户可从此处使用FB帐户登录。我有另一个ViewController,它会在用户登录后正确加载。在AppDelegate文件中,我正在检查currentAccessToken,如果它不是nil,我将直接加载第二个ViewController,因为用户已经登录。但是,如果我退出应用程序并重新启动它,currentAccessToken始终为nil。仅当我按下主页按钮并在应用程序仍在后台运行时重新打开它时它才有效。以下是代

ios - Facebook iOS SDK FBSDKAccessToken.currentAccessToken() 即使在登录时也为零?

我在使用FBSDKAccessToken时遇到一些奇怪的行为:overridefuncviewDidLoad(){super.viewDidLoad()//Doanyadditionalsetupafterloadingtheview,typicallyfromanib.println(FBSDKAccessToken.currentAccessToken())//printsnilif(FBSDKAccessToken.currentAccessToken()!=nil){//Userisalreadyloggedin,doworksuchasgotonextviewcontroll

ios - FBSDKProfile currentProfile 为 nil 但 FBSDKAccessToken currentAccessToken 有值

正如标题所说,这是一个错误还是真的有可能?我使用[FBSDKAccessTokencurrentAccessToken].tokenString检查现有的Facebooksession是否存在,然后我将使用[FBSDKProfilecurrentProfile].userID获取session的用户身份。但是有时我会遇到[FBSDKAccessTokencurrentAccessToken].tokenString有一个值但是[FBSDKProfilecurrentProfile]是nil。我将它用于我的应用程序的自动登录功能。感谢您的回复!所以我有这个代码片段:if([FBSDKAc

ios - 无法在我的 iOS9 应用程序中打印 FBSDKAccessToken.currentAccessToken().tokenString

出于学习目的,我在Swift中为iOS9创建了一个应用程序。当我通过我的应用程序登录Facebook时,我试图打印Facebook当前的访问token。当我单击fblogin按钮时,它会打开Safari并显示我已经授权了我的应用程序,但是当我单击“确定”时,它停留在Safari页面上并且没有按应有的方式打印token。它说:fatalerror:unexpectedlyfoundnilwhileunwrappinganOptionalvalue我正在使用XCode7.3.1。我正在添加代码的图片: 最佳答案 可能是此时在完成处理程序

ios - FBSDKAccessToken.currentAccessToken().userID 有时返回 Nil

我正在尝试创建一个个人资料注册页面,并在从“使用Facebook登录”页面转入后从Facebook分配图像。然而在这条线上...letuserID=FBSDKAccessToken.currentAccessToken().userID...有时它工作得很好但有时返回“nil”,我得到了'2015-04-1615:08:41.195FacebookLogin[65906:4225996][Error]:invalidsessiontoken(Code:209,Version:1.7.1)fatalerror:unexpectedlyfoundnilwhileunwrappinganOp

ios - FBSDKAccessToken currentAccessToken 登录后未更新

我实现了一个Facebook登录按钮,效果非常好。但是,在用户成功登录Facebook并返回到应用后,[FBSDKAccessTokencurrentAccessToken]返回NO。我添加了一个观察者,以查看返回应用程序后我想要的代码是否正在运行:-(void)viewDidLoad{[[NSNotificationCenterdefaultCenter]addObserver:selfselector:@selector(checkLogIn)name:UIApplicationWillEnterForegroundNotificationobject:nil];}-(void)c
12