1

ウォールにメッセージを投稿しようとしていますが、この投稿で一度に複数のユーザーにタグを付けたいと考えています。FB 投稿ページでさまざまなオプションを試しましたが、できませんでした。私はそれを正しくしていないかもしれません。どんな助けでも大歓迎です。これが私がやっている方法です...

NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                               @"Test 2",@"message",
                               @"100004311843201,1039844409", @"to",
                               nil];
[self.appDelegate.facebook requestWithGraphPath:@"me/feed" andParams:params andHttpMethod:@"POST" andDelegate:self];

私も試してみmessage_tagsましたが、うまくいかないようです。

4

3 に答える 3

4

人にメッセージのタグを付けるには、Open Graph を使用する必要があります。me/feed Graph API エンドポイントはこれをサポートしていません。

メンションのタグ付け https://developers.facebook.com/docs/technical-guides/opengraph/mention-tagging/

アクションのタグ付け: https://developers.facebook.com/docs/technical-guides/opengraph/publish-action/

これを行う方法については、最新の Facebook SDK for iOS に含まれている Scrumptious サンプル アプリを参照してください。

于 2012-12-21T19:16:27.313 に答える
2

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:58:45.863 に答える
0

Open Graph for iOS のセットアップ方法に関するチュートリアルに従った場合、friendsPickerController を使用すると、次のようなことができます。

// Create an action
id<FBOpenGraphAction> action = (id<FBOpenGraphAction>)[FBGraphObject graphObject];

//Iterate over selected friends
if ([friendPickerController.selection count] > 0) {
    NSMutableArray *temp = [NSMutableArray new];
    for (id<FBGraphUser> user in self.friendPickerController.selection) {
        NSLog(@"Friend selected: %@", user.name);
        [temp addObject:[NSString stringWithFormat:@"%@", user.id]];
    }
    [action setTags:temp];
}

基本的に、アクションの「tags」プロパティに友人の ID の配列を設定できます。

于 2014-03-29T16:25:19.357 に答える