2011年5月23日 星期一

How to post message to Facebook from iPhone App

Step 1: Create a new application of facebook from here

Step 2: Download Facebook SDK
Step 3: Add Facebook SDK into your project
Step 4: Replace the Api Key Values in FBControl.m


static NSString* kApiKey = @"578b8cdff0fce3aad6b249162bca2e15";
static NSString* kApiSecret = @"09c0f53fa229b45318099aa728b496ef";

Step 5: Replace the definition of strings
#define POST_NAME               @"iOSApp test name message!"
#define POST_WEBSITE            @"http://www.erawppa.com/"
#define POST_CAPTION            @"iOSApp caption message!"
#define POST_PRODUCT_ICON       @"http://www.erawppa.com/notymoky/images/p5.jpg"
#define POST_PRODUCT_WEBSITE    @"http://www.erawppa.com/notymoky"
#define POST_MSGPROMPT_FMT      @"enter your message"

Step 6: Using Facebook SDK
    FBControl *fbControl_ = [[FBControl alloc]init];
    [fbControl_ postToFacebook:@"98765443"];

沒有留言:

張貼留言