Find Facebook SDK Version on iOS

I know that I am using the latest version (v3.2.1) But I want to find it in the header or programmatically

This may be a stupid question, but on iOS I cannot find the version number in the FacebookSDK.framework headers.

+55
ios facebook
Apr 01 '13 at 2:20
source share
10 answers

After about 2014, just do the following:

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



For very old versions. Up to 3.6:

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

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

Worked for me with sdk 3.5.1

Hope this helps ...




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

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

+102
Jul 10 '13 at
source share

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

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

enter image description here

+14
Jun 05 '16 at 10:50
source share

Take a look at FBSDKVersion.h . Define there:

#define FB_IOS_SDK_VERSION_STRING @"3.2.1"

+10
Apr 01 '13 at 2:37
source share

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

 #import <FBSDKCoreKit/FBSDKCoreKit.h> - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { NSLog(@"### Running FB SDK Version: %@", [FBSDKSettings sdkVersion]); } 
+9
Mar 31 '15 at 16:42
source share

From the SDK directory, I did:

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

Among other things, the following string was returned:

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

This will help you identify the version without requiring an actual link / launch / log.

Facebook may be the only technology company in the world that omits the version number from its tar / zip file, as well as the unpacked root directory. I find it puzzling.

+3
May 4 '16 at 17:42
source share

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.

+2
Sep 25 '15 at 12:03
source share

To check the current SDK version on facebook, use the following line:

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

In my case, SDK version 4.8.0

Tested against fast 2.0 and xCode 7.0 +

+2
Nov 20 '15 at 16:06
source share

For Facebook SDK 3.18 I had to do

 #import <FacebookSDK/FacebookSDK.h> - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { NSLog( @"My app is running FB sdk version: %@", [FBSettings sdkVersion]); } 
0
Oct 09 '16 at 2:54 on
source share

Try (Android) - I just posted this because I was looking for this answer and not seen for Android.

 String s = FacebookSdk.getSdkVersion(); Log.d("FacebookSKD_V",s); 
0
Dec 12 '18 at 3:50
source share

If you use modules, you can check them in the Info.plist file:

"Pods/FBSDKCoreKit/Support Files/Info.plist"

Version is key CFBundleShortVersionString

Example:

 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>en</string> <key>CFBundleExecutable</key> <string>${EXECUTABLE_NAME}</string> <key>CFBundleIdentifier</key> <string>${PRODUCT_BUNDLE_IDENTIFIER}</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>${PRODUCT_NAME}</string> <key>CFBundlePackageType</key> <string>FMWK</string> <key>CFBundleShortVersionString</key> <string>4.18.0</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> <string>${CURRENT_PROJECT_VERSION}</string> <key>NSPrincipalClass</key> <string></string> </dict> </plist> 
0
Dec 12 '18 at 15:27
source share



All Articles