Hi I have create an event on Facebook through my iOS app by following code
-(void) createEvent:(NSString*)eventName Eventdesc:(NSString*)eventdesc EventDate: (NSString*)eventDate{
NSURL *meurl = [NSURL URLWithString:@"https://graph.facebook.com/me/events"];
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
eventName, @"name",
eventdesc, @"description",
[NSString stringWithFormat:@"%@",[NSDate date]], @"start_time",
nil];
SLRequest *merequest = [SLRequest requestForServiceType:SLServiceTypeFacebook
requestMethod:SLRequestMethodPOST
URL:meurl
parameters:params];
merequest.account = _facebookAccount;
[merequest performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) {
NSString *meDataString = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
NSLog(@"event %@", meDataString);
if (!error) {
UIAlertView *alertView=[[UIAlertView alloc] initWithTitle:@"" message:@"Thanks for your support. Event has been created on your facebook page." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil,nil];
[alertView show];
}else{
UIAlertView *alertView=[[UIAlertView alloc] initWithTitle:@"" message:@"Unable to create event on facebook." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil,nil];
[alertView show];
}
}];
}
Now I want to invite friends to this created event. I search lot but I did not get any helpful information. please help. Thank you in advance.
You can invite users to an event by issuing an
HTTP POST to /EVENT_ID/invited/USER_ID
. You can invite multiple users by issuing an HTTP POST to /EVENT_ID/invited?users=USER_ID1,USER_ID2,USER_ID3
. Both of these require the create_event permission and return true if the invite is successful.