Find Facebook SDK Version on iOS

后端 未结 10 954
暖寄归人
暖寄归人 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条回答
  •  猫巷女王i
    2020-12-04 19:23

    After about 2014, simply do this:

    NSLog( @"### running FB sdk version: %@", [FBSDKSettings sdkVersion] );
    

    For very old versions. Before about 3.6:

    I found an undocumented way to print the SDK version (FB_IOS_SDK_VERSION_STRING), try this

    NSLog(@"### FB SDK VERSION : %@",
        [[FBRequestConnection class] performSelector:@selector(userAgent)]);
    

    Worked for me with sdk 3.5.1

    Hope that helps...


    Update: As of FB SDK 3.6, "The SDK version number is defined in FacebookSDK.h and available from [FBSDKSettings sdkVersion]"

    https://developers.facebook.com/ios/change-log-3.x/

提交回复
热议问题