要在您的 fb 状态中标记朋友..您需要使用 FBFriendPickerViewController 的朋友的“facebook id”和使用 FBPlacePickerViewController 的“place 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];
}
}