如何在Facebook游戏中提出挑战请求

时间:2012-06-15 09:35:04

标签: facebook facebook-graph-api facebook-requests

我是使用facebook SDK的新手。

我在facebook上有一种racin app,我想挑战其他朋友。也没有安装该应用程序的朋友。

我在facebook开发者页面上阅读

  

匹配制作

     

请记住,请求可以发送给已经拥有的玩家   安装了游戏;

但为了吸引更多用户,我还想向我朋友列表中的任何用户发送质询请求。

我是否必须向那些尚未安装应用程序的人发送应用程序请求?

有没有人在Facebook上玩匹配游戏的经验?网上可能有一个很好的教程吗? FB Doc对我来说非常肤浅。

提前致谢

1 个答案:

答案 0 :(得分:0)

在您的应用程序中导入FacebookSDK并使用以下代码。

[FBWebDialogs presentRequestsDialogModallyWithSession:nil
       message:[NSString stringWithFormat:@"I just smashed %d friends! Can you beat it?", nScore]
       title:@"Smashing!" parameters:params handler:^(FBWebDialogResult result, NSURL *resultURL, NSError *error)
       {
             if (error) 
             {
                    // Case A: Error launching the dialog or sending request.
                    NSLog(@"Error sending request.");
             } else 
             {
                    if (result == FBWebDialogResultDialogNotCompleted) {
                        // Case B: User clicked the "x" icon
                        NSLog(@"User canceled request.");
                    } else {
                        NSLog(@"Request Sent.");
                    }
             }}
             friendCache:nil];
        }
相关问题