Find Facebook SDK Version on iOS

后端 未结 10 933
暖寄归人
暖寄归人 2020-12-04 18:51

I know I\'m using the latest version (v3.2.1). But I want find it in header or programmatically.

In iOS I can\'t find version number in FacebookSDK.framework headers

相关标签:
10条回答
  • 2020-12-04 19:39

    From the SDK directory I did:

    % find . -name \*.h -exec fgrep -i version {} /dev/null \;
    

    Amongst other stuff, the following line was returned:

    ./FBSDKCoreKit.framework/Headers/FBSDKCoreKit.h:#define FBSDK_VERSION_STRING @"4.11.0"
    

    This will help you identify the version without needing to actually link/run/log.

    Facebook might possibly be the only technology company in the world that omits the version number from their tar/zip file, as well as the unpacked root directory. I find this baffling.

    0 讨论(0)
  • 2020-12-04 19:43

    To check the current version of facebook SDK use below line:

        print("SDK version \(FBSDKSettings .sdkVersion())")
    

    In my case, SDK version 4.8.0

    Tested against swift 2.0 and xCode 7.0+

    0 讨论(0)
  • 2020-12-04 19:44

    Try(Android) - I only posted this because I was looking for this answer and didn't see for android.

    String s = FacebookSdk.getSdkVersion();
                    Log.d("FacebookSKD_V",s);
    
    0 讨论(0)
  • 2020-12-04 19:47

    In swift 2, FBSDK 4.4 you can output the version string:

    print("FBSDK Version: \(FBSDK_VERSION_STRING)");
    //outputs:
    //FBSDK Version: 4.4.0
    

    FBSDKSettings.version() returned 0 for me.

    0 讨论(0)
提交回复
热议问题