I'm trying to get this set up for my company: https://developers.facebook.com/docs/tutorials/mobile-app-ads/
I used the instructions here to get it into our app: https://developers.facebook.com/docs/getting-started/facebook-sdk-for-ios/3.1/
From my initial attempt to integrate and get data, it seems like this can only work for iOS 6.
When I run the app for iOS 6 simulator it runs fine, but for an actual device running iOS 5, it fails during linking:
ld: framework not found Social
Is it true that this FB SDK functionality can only work in iOS 6+ apps? If so, does anyone know how to integrate with FB mobile ads reporting for apps that support iOS 4.3 to iOS 6+.
Thanks!
The new SDK actually requires 6.
Not sure what was causing the error, but to eliminate the build problem, I just cleaned the build folder, deleted the derived data from the project, and removed & re-added the facebook libs.
Then to prevent this from blowing up on pre-iOS 6 situations I added this to my app:
+ (BOOL)isSocialFrameworkAvailable
{
static BOOL available = NO;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
available = NSClassFromString(@"SLComposeViewController") != nil;
});
return available;
}
- (BOOL)application: (UIApplication *) application didFinishLaunchingWithOptions: (NSDictionary *) launchOptions
{
// [...]
if ([[self class] isSocialFrameworkAvailable]) {
[FBSettings setLoggingBehavior:[NSSet setWithObjects:
FBLoggingBehaviorFBRequests,
FBLoggingBehaviorFBURLConnections,
FBLoggingBehaviorAccessTokens,
FBLoggingBehaviorPerformanceCharacteristics,
FBLoggingBehaviorSessionStateTransitions,
nil]];
NSDate *facebookIdPublishedDate = [[NSUserDefaults standardUserDefaults] objectForKey:@"facebookIdPublishedDate"];
if (!facebookIdPublishedDate) {
[[NSUserDefaults standardUserDefaults] setObject:[NSDate date] forKey:@"facebookIdPublishedDate"];
[FBSettings publishInstall:@"XXXXXXXXXXXXXXXX"];
}
}
// [...]
}