Skip to content

linox/FacebookSample

Repository files navigation

This project based on https://github.com/doubleencore/DETweetComposeViewController

Facebook connection based on SDK 3.0.x (last at 2 september 2012)


What is it?
DEFacebookComposeViewController is an iOS 4 compatible. 
Looks like as the Facebook Sheet in iOS 6.


How to use

1. download and setup Facebook sdk https://developers.facebook.com/ios/

2. register your app on http://developers.facebook.com

3. replace on your app id in plist file. FacebookAppID and in CFBundleURLTypes

4. #import "DEFacebookComposeViewController.h"

5.
 DEFacebookComposeViewControllerCompletionHandler completionHandler = ^(DEFacebookComposeViewControllerResult result) {
        switch (result) {
            case DEFacebookComposeViewControllerResultCancelled:
                NSLog(@"Facebook Result: Cancelled");
                break;
            case DEFacebookComposeViewControllerResultDone:
                NSLog(@"Facebook Result: Sent");
                break;
        }
        
        [self dismissModalViewControllerAnimated:YES];
    };
    
    DEFacebookComposeViewController *facebookViewComposer = [[DEFacebookComposeViewController alloc] init];
    self.modalPresentationStyle = UIModalPresentationCurrentContext;
    [facebookViewComposer setInitialText:@"Look on this"];
    [facebookViewComposer addImage:[UIImage imageNamed:@"1.jpg"]];
    facebookViewComposer.completionHandler = completionHandler;
    [self presentViewController:facebookViewComposer animated:YES completion:^{ }];



Post on my blog http://www.developers-life.com/facebook-compose-view.html
Welcome for any questions


About

Facebook compose sheet view

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published