Hello,
I'm developing an iPhone app which has to integrates Events creation on Facebook. Regarding that, I have a couple of questions and I hope that you will help me. If some of these questions are already been answered, my apology, but I had no luck with searching the forum.
1) I had to integrate ShareKit in my project because I need Twitter action as well, but in Facebook folder there are FBSession and all other classes for FBConnect. Question: which version of FBConnect is better to use, one with the Facebook class, or one with the FBSession class?
2) Is it possible to create an event with FBSession version?
Code:
NSString *eventString = [NSString stringWithFormat:@"{\"name\":\"Test Event\",\"start_time\":\"1215929160\",\"end_time\":\"1215929160\",\"location\":\"SomeWhere\"}"];
NSDictionary *params = [NSDictionary dictionaryWithObject:eventString forKey:@"event_info"] ;
[[FBRequest requestWithDelegate:self] call:@"facebook.events.create" params:params];
I can't make this work in that version. When I tried with the version which has Facebook class, then I put:
Code:
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"My Test Event", @"name",
@"2011-03-14", @"start_time",
@"2011-03-15", @"end_time",
@"privacy", @"SECRET",nil];
MyAppDelegate *appDelegate = (MyAppDelegate *)[UIApplication sharedApplication].delegate;
[appDelegate.facebook requestWithGraphPath:@"me/events" andParams:params andHttpMethod:@"POST" andDelegate:self];
That seemed to work. I actually created an event. I want to use FBSession version because, there I have FBLoginButton class and then I avoid using Safari because of [facebook authorize]; method.
If you suggest me to use version which has Facebook class in it, how to put venue in dictionary? I have a trouble reading Facebook API documentation. There it says:
"venue: A JSON object containing street, city, state, zip, country, latitude, and longitude fields"
How to store it in NSMutableDictionary?
Thanks.