我有一个名为FBSession
. 我知道会话已打开,但我如何发送图形请求以创建事件,然后邀请用户参加该事件?我知道用户的 Facebook ID,因为我设法从本地地址簿属性中提取了它们。
if (appDelegate.session.state == FBSessionStateCreatedTokenLoaded) {
// even though we had a cached token, we need to login to make the session usable
[appDelegate.session openWithCompletionHandler:^(FBSession *session,
FBSessionState status,
NSError *error) {
switch (status) {
case FBSessionStateOpen:
{
/* What do I do here to create the event and invite IDs x, y and z where z, y and z are long long Facebook Ids */
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"venue name",@"name",
@"2012-01-13T17:00:00+0000",@"start_time",
@"2012-01-16T01:30:00+0000",@"end_time",@"location",@"location name ch",@"1234567890",@"id", nil];
FBRequest *facebook = [[FBRequest alloc] initWithSession:appDelegate.session graphPath:@"me/events" parameters:params HTTPMethod:@"POST"];
这些是否正确,我需要运行哪些委托方法来检查它在 appDelegate 中是否正常工作?