且构网

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

facebook android sdk中使用的facebook api版本

更新时间:2021-11-03 08:06:33

我遇到了同样的问题,而且很烦人的是,我在文档中找不到任何关于此的信息.但是,您可以参考这两个链接:

I had the same problem, and annoyingly, I couldn't find anything about this in documentation. You can, however, refer to these two links:

https://developers.facebook.com/docs/android/upgrading-3.xhttps://developers.facebook.com/docs/android/upgrading-4x

并推断您的版本 (3.23.0) 是 Graph API 版本 2.2 或 2.3 - 无法弄清楚它是两者中的哪一个.或者,您似乎可以从代码中调用此函数:

And induce that your version (3.23.0) is on either Graph API version 2.2 or 2.3 - couldn't quite figure out which one of the two it is. Alternatively it seems that you can call this function from your code:

com.facebook.internal.ServerProtocol.getAPIVersion();

这应该返回您可以记录的当前图形 API 版本的字符串.就我而言,对于 SDK 版本 4.0.1,它是 Graph API "v2.3"

This should return a String of the current Graph API version that you can log. In my case, for SDK version 4.0.1, it was Graph API "v2.3"

更新:似乎在较新版本的 FB SDK(刚刚在 v4.23.0 中尝试过)中,getApiVersion() 已更改为 getDefaultAPIVersion().似乎做同样的事情.

Update: It seems that in newer versions of the FB SDK (just tried it in v4.23.0), getApiVersion() has been changed into getDefaultAPIVersion(). Seems to do the same thing.