且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

FB iOS SDK自定义令牌缓存问题

更新时间:2023-12-04 22:42:40

策略将返回没有权限的FBAccessTokenData(除非您也要存储权限,否则这对您而言并非完全不合理)。但是,当您初始化会话时,指定 basic_info(通常是一个很好的***实践,并且在要求登录的提示提示UI时要求提供)将导致它检查 basic_info是否包含在缓存的令牌中。由于不是,因此不会加载缓存的令牌。为了您的目的,您应该能够使用nil权限数组来初始化会话。

It looks like your strategy is returning an FBAccessTokenData that has no permissions (which is not entirely unreasonable for your purposes unless you were to store permissions as well). When you init the session, however, specifying "basic_info" (while generally a good best practice, and required when asking for login that would prompt UI) will cause it to check that "basic_info" is included in the cached token. Since it is not, it will not load the cached token. For your purposes, you ought to be able to init the session with a nil permission array.