简体   繁体   English

如何从Facebook SDK获取accessToken

[英]How to get the accessToken from Facebook SDK

I'm using the latest Facebook's SDK, and I need to get the token to send to a server. 我正在使用最新的Facebook SDK,并且需要获取令牌才能发送到服务器。 Following the Facebook's documentation the way to get the token is FBSession *session and to get the accessToken property from the session like this session.accessToken but xCode keeps telling me this is deprecated. 按照Facebook的文档,获取令牌的方法是FBSession * session,并从会话中获取该会话的accessToken属性,就像session.accessToken但是xCode告诉我这已被弃用。

Any idea? 任何想法?

Thanks! 谢谢!

Just found the answer. 刚找到答案。 I will leave it here so it helps someone else! 我将其留在此处,以帮助其他人!

[session accessTokenData].accessToken

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM