FMFacebookPanel is a class that replicates SLComposeViewController native Facebook sharing functionalities introduced in iOS6 and extends their availability in iOS5. Three types of sharing are supported: text, link and photo. Also it enables "Share attribution" on the content posted on the wall: content shared via the native SLComposeViewController gets an attribution of "via iOS", with FMFacebookPanel the content will be associated correctly to your app.
The component UI mimics the original native dialog and is optimized for all rotations and screen sizes.
FMFacebookPanel has been recently updated to use the version 3.5 of Facebook SDK. The latest version of the SDK requires two separate steps to grant "read" and "write" permission. However, due to the basic purpose of this component, FMFacebookPanel uses deprecated methods that allow to request read and write permissions at the same time.
-
Follow instructions for basic Facebook SDK integration: https://developers.facebook.com/docs/getting-started/facebook-sdk-for-ios/
-
Drag the FMFacebookPanel folder into your Xcode project
-
Add the
<QuartzCore/QuartzCore.h>
framework -
Download the SVProgressHUD and add it to the project
-
Add the code below to your AppDelegate.m file:
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
return [FBAppCall handleOpenURL:url sourceApplication:sourceApplication];
}
*NOTE: the supported build target is iOS 5.0 (Xcode 4.5)
(see sample Xcode project /Demo
)
Use the shared view controller to set the initial text with an image:
[FMFacebookPanel sharedViewController].postText = @"Image text here";
[FMFacebookPanel sharedViewController].postImage = [UIImage imageNamed:@"Flubber.png"];
[[FMFacebookPanel sharedViewController] present];
or a link:
[FMFacebookPanel sharedViewController].postText = @"Link text here";
[FMFacebookPanel sharedViewController].postLink = @"http://flubbermedia.com";
[[FMFacebookPanel sharedViewController] present];
FMFacebookPanel was created by Maurizio Cremaschi and Andrea Ottolina for Flubber Media Ltd.
This component is currently used by these apps:
- Facebomb: https://itunes.apple.com/app/id523279606
- Stickers: https://itunes.apple.com/app/id527239154