Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find which version of FacebookSDK.framework for iOS you are using? [duplicate]

Tags:

ios

facebook

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.

like image 421
tom19830924 Avatar asked Apr 01 '13 02:04

tom19830924


People also ask

What is Facebook SDK for iOS?

The Facebook SDK enables: Facebook Login - Authenticate people with their Facebook credentials. Share and Send dialogs - Enable sharing content from your app to Facebook. App Events - Log events in your application.


8 Answers

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/

like image 78
poloDelaVega Avatar answered Oct 02 '22 18:10

poloDelaVega


You can find the version of your Facebook SDK in FBSDKCoreKit.h defined as

#define FBSDK_VERSION_STRING @"X.XX.X". Have a look at the image below.

enter image description here

like image 27
Adeel Miraj Avatar answered Sep 30 '22 18:09

Adeel Miraj


Take a look at FBSDKVersion.h. There's a define there:

#define FB_IOS_SDK_VERSION_STRING @"3.2.1"

like image 37
Marcelo Fabri Avatar answered Sep 30 '22 18:09

Marcelo Fabri


For those running SDK version >= 4, [FBSDKSettings sdkVersion].

#import <FBSDKCoreKit/FBSDKCoreKit.h>

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    NSLog(@"### Running FB SDK Version: %@", [FBSDKSettings sdkVersion]);
}
like image 36
John Erck Avatar answered Sep 28 '22 18:09

John Erck


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.

like image 33
jules Avatar answered Sep 29 '22 18:09

jules


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.

like image 27
bJacoG Avatar answered Oct 02 '22 18:10

bJacoG


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+

like image 31
Himanshu Mahajan Avatar answered Oct 01 '22 18:10

Himanshu Mahajan


There is no way to get it on SPM after 11.0 from Xcode 12.

like image 20
ingconti Avatar answered Oct 01 '22 18:10

ingconti