Find Facebook SDK Version on iOS
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/
Which version the Facebook iOS SDK that Facebook Unity SDK v6.2.2 is rely on?
Maybe not the best approach but this should work. In your app delegate or anywhere convenient:
#import <FBSDKCoreKit/FBSDKCoreKit.h>
and then in one of the methods:
NSLog(@"Fb iOS SDK version: %@", [FBSDKSettings sdkVersion]);
That should give you the version number of the Facebook SDK. I tried this with Unity 7.1.0
and it gave back Fb iOS SDK version: 4.6.0
But if the SDK is using an older version of the Facebook SDK, the import should fail and if that happens, you can try the steps outlined here.
Is Facebook SDK Documentation for Swift outdated? What is the corresponding SDK version?
The SDK has been updated for Swift 4, but apparently not the documentation. The correct Swift 4 syntax for creating NSURL
from a string requires a string
argument label:
let url = NSURL(string: "https://developers.facebook.com")
You are looking at Facebook's official documentation, so I don't know where to point you to anything more up-to-date. It might help to re-type their example code into your project so you can get the right auto-completion suggestions from Xcode.
EDIT: In Swift, many classes with the NS
prefix have been replaced by classes without the prefix. For example, NSURL
has been replaced in favor of URL
. Facebook has updated their LinkShareContent
class to take a URL
in the initializer:
public init(url: URL, quote: String? = nil)
So this should work:
let content = LinkShareContent(url: URL(string: "https://developers.facebook.com"))
P.S. Again, this is the reason you should re-type their example code instead of copy/pasting. As soon as you type let content = LinkShareContent(
, Xcode will you show you that the initializer needs a URL
not NSURL
.
Related Topics
How to Know If Nsassert Is Disabled in Release Builds
Swift:Missing Argument Label 'Xxx' in Call
Change the Font Size of Uisearchbar
How to Check If a Uialertcontroller Is Already Presenting
Differencebetween a Development Provisioning Profile and an Ad Hoc Provisioning Profile
How to Rotate an Uiimageview by 20 Degrees
Swift - Coredata Migration - Set New Attribute Value According to Old Attribute Value
How to Move Cursor from One Text Field to Another Automatically in Swift iOS Programmatically
Adding Click Event on Infowindow/Marker in Google Maps Sdk for Native iOS/Objective C
How to Calculate the Age Based on Nsdate
Implementing Unit Testing with iOS
Uitextview Starts at Bottom or Middle of the Text
Sendasynchronousrequest Was Deprecated in iOS 9, How to Alter Code to Fix
Find Facebook Sdk Version on iOS