MJFBWrapper is an FBConnect wrapper for the iPhone which makes it easier to post messages to the Facebook Wall. It also includes support for ImageShack when you want to post messages containing images.
Adding MJFBWrapper to your project
- Download and install FBConnect, instructions and download link
- Download the latest code version from the repository.
- Extract the archive.
- Open the project in Xcode.
- Drag and drop the
MJFBWrappergroups to your classes group (in the Groups & Files view).
- Make sure to select Copy items when asked.
This example takes care of the whole connect and permission process on Facebook.
FBSession *session = [FBSession sessionForApplication:kAPIKey secret:kAPISecret delegate:self]; [session resume]; MJFBStreamAttachment *attachment = [[[MJFBStreamAttachment alloc]init] autorelease]; attachment.message = @"Message"; attachment.name = @"Name"; attachment.description = @"Description"; attachment.href = @"http://www.domain.com"; attachment.caption = @"Caption" attachment.actionLink = [MJFBActionLink linkWithText:@"action" href:@"http://www.action.com"]; [attachment.properties addObject:[MJFBAttachmentProperty propertyWithName:@"aName" text:@"text" href:@"http://www.text.com"]]; MJFBStream *fbStream = [[MJFBStream alloc] initWithFBSession:session delegate:self]; [fbStream publishAttachment:attachment]; [fbStream release];
The project contains a simple demo which should give you an idea on how to use it.
Add your Facebook API key and secret in
MJFBWrapperAppDelegate.m build and run to try it out.
MJFBWrapperAppDelegate.m for the demo code.