0

ウォール投稿で友達の何人かにタグを付けようとしていて、次のパラメーターを送信していますが、この投稿はウォールに投稿され、提供した FB ID が投稿に添付されません...

NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:

                               @"Test 2  ",@"message",
                               @"100004311843201 , 1039844409", @"to",
                               @"http://www.google.com", @"link",
                               @"Test", @"name",
                               nil];

[self.appDelegate.facebook requestWithGraphPath:@"me/feed" andParams:params andHttpMethod:@"POST" andDelegate:self];

どんな助けでも大歓迎です...

4

1 に答える 1

0

あなたのfbステータスで友達にタグを付けるには..FBFriendPickerViewControllerを使用して友達の「facebook ID」とFBPlacePickerViewControllerを使用して「場所ID」が必要です。次のコードが役立ちます。

  NSString *apiPath = nil;

apiPath = @"me/feed";



if(![self.selectedPlaceID isEqualToString:@""]) {

    [params setObject:_selectedPlaceID forKey:@"place"];

}

NSString *tag  = nil;
if(mSelectedFriends != nil){
    for (NSDictionary *user in mSelectedFriends) {
        tag = [[NSString alloc] initWithFormat:@"%@",[user objectForKey:@"id"] ];

        [tags addObject:tag];

    }

    NSString *friendIdsSeparation=[tags componentsJoinedByString:@","];
    NSString *friendIds = [[NSString alloc] initWithFormat:@"[%@]",friendIdsSeparation ];

    [params setObject:friendIds forKey:@"tags"];
}

FBRequest *request = [[[FBRequest alloc] initWithSession:_fbSession graphPath:apiPath parameters:params HTTPMethod:@"POST"] autorelease];

[request startWithCompletionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
    [SVProgressHUD dismiss];

    if (error) {
        NSLog(@"Error ===== %@",error.description);
        if (_delegate != nil) {
            [_delegate facebookConnectFail:error requestType:FBRequestTypePostOnWall];
        }else{
            NSLog(@"Error ===== %@",error.description);
        }


    }else{

        if (_delegate != nil) {
            [_delegate faceboookConnectSuccess:self requestType:FBRequestTypePostOnWall];
        }
    }
于 2013-06-25T10:53:19.043 に答える