I am pretty new at programming, so please don’t burn me too bad. I downloaded the Hackbook version for Facebook. However, I have a number of view controllers that will use the ‘share this’ button but I don’t know how to do it. I know that I want to use the functions that are already in place.
@implementation ViewConcertsViewController
...
-(IBAction)shareThis:(id)sender{
[appDelegate.facebook authorize:nil delegate:self];
APICallsViewController *apiViewController = [[APICallsViewController alloc] initWithNibName:nil bundle:nil];
[apiViewController shareButton];
}
Then in my APICallsViewController, I have:
-(void)shareButton{
[self performSelector:@selector(//what do I put in here!!!!)];
}
Thank you in advance.
This is what I did:
@implementation ViewConcertsViewController
...
-(IBAction)shareThis:(id)sender{
APICallsViewController *apiViewController = [[APICallsViewController alloc] initWithNibName:nil bundle:nil];
[apiViewController shareButton:sender];
}
@implementation APICallsViewController
...
-(void)shareButton:(id)sender{
SEL selector = NSSelectorFromString(@"getAppUsersFriendsNotUsing");
if ([self respondsToSelector:selector]) {
[self performSelector:selector];
}
}
Thank you.
Looks like you just need to change up the method in the Hackbook Sample in the APICallsViewController.
But if you looking to send an AppRequest (not the same thing as share button on a webpare) then checkout
- (void)apiDialogRequestsSendTarget:(NSString *)friendSo what do you want to share? A status update, a photo, a link to a URL, a Facebook app request there is. Lot to share so it’s kind of hard to know where you want to go. [limk]http://developers.facebook.com/docs/reference/iossdk/request/. And hers [link]http://developers.facebook.com/docs/reference/dialogs/ there are 7 default one-two line code to share stuff
There are currently 7 Dialogs available for you to use:
**
-The Feed Dialog allows a user to post a story to their Timeline and to their friends’ News Feeds
-The OAuth Dialog allows a user to authorize an application as part of an authentication flow.
-The Add Page Tab Dialog allows a user to add an application to a Facebook Page which they administer.
-The Friends Dialog allows a user to send a friend request to another user.
-The Pay Dialog allows a user to make a purchase using Facebook Credits.
-The Requests Dialog allows a user to send a request to one or more of their friends
-The Send Dialog allows a user to send a Facebook Message to one or more of their friends.
**
But if you can give more details of the tasks it will make it easier to provide help and samples.
For my expierence setting up application project in xcode to use the fb sdk with your custom app Id from apple and Facebook is the hard part. I would highly reccomend starting a Xcode project from scratch. It will take a bit more but once you set up an app from start to logged-in and have friends data via FBRequest you will be able to move very fast.
Starting from an sample app you will always have stuff in the background going on you can’t fix or improve or really use the API like you want.