Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to invite friends to my application via facebook iOS SDK and Graph API

Tags:

I'm writing an iPhone application.

I want to give the user the option to invite friends to start using my application via Facebook.

More specifically I want to present a dialog that will let the user to select specific friends to invite.

How can I do this?

Thanks.

like image 775
zeevblu Avatar asked May 31 '12 13:05

zeevblu


People also ask

Does Facebook allow API?

The Graph API is the primary way to get data into and out of the Facebook platform. It's an HTTP-based API that apps can use to programmatically query data, post new stories, manage ads, upload photos, and perform a wide variety of other tasks.


1 Answers

It's simple you can just write the below code for personalised message and also you can easily select the friend's to whom the request should be sent, it's an straight forward and powerful method.

 [FBWebDialogs  presentRequestsDialogModallyWithSession:nil  message:NSLocalizedString(@"FBinviteMessage", nil)  title:nil  parameters:nil  handler:^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {} ]; 

Just add this six line of code to your Button action method, then the rest will be done by the IOS & FaceBook Inbuilt framework :)

like image 135
Prabhu Natarajan Avatar answered Sep 28 '22 00:09

Prabhu Natarajan