1

我正在从我的应用程序向 fb 朋友发送请求,但我没有在我发送请求的 fb 用户的墙上收到任何通知?

我正在使用 FB SDK 3.2(我希望它是最新的)

以下是我用来发送请求的代码

NSMutableDictionary* params =   [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                     friendList, @"to",
                                     nil];
    [FBWebDialogs presentRequestsDialogModallyWithSession:nil
        message:[NSString stringWithFormat:@"I just smashed %d friends! Can you beat it?", 15]
        title:@"Total Smashed Score"
        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.");
                }
            }
        }
     ];

请求对话框正确显示,当我单击发送按钮时,邀请已发送但未显示在用户墙上。任何类型的帮助将不胜感激。

问候。

4

2 回答 2

1

邀请永远不会显示在用户的墙上/时间线上。只有他们被发送到的用户才能私下查看。将显示在“请求”页面上或作为通知用户。

于 2013-06-28T13:14:59.593 回答
0

这是我的解决方案

//friendlist = NSString of fb id's

NSMutableDictionary* params =   [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                     friendList, @"to",
                                     nil];
    [FBWebDialogs presentRequestsDialogModallyWithSession:nil
        message:[NSString stringWithFormat:@"message!"]
        title:@"title"
        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 {
                    NSDictionary *urlParams = [self parseURLParams:[resultURL query]];
                    if (![urlParams valueForKey:@"request"]) {
                        // User clicked the Cancel button
                        NSLog(@"User clicked cancel button.");
                    } else {
                        nslog("succesfully sent invites");
                    }
                }
            }
        }
     ];
于 2013-08-26T06:18:29.520 回答