简体   繁体   English

如何使用Facebook SDK Android在墙上张贴信息时标记朋友

[英]How to tag a friend, while post on wall using facebook sdk android

I need the key which specifies a friends that can be taged in a post (facebook) 我需要指定可以在帖子(facebook)中标记的朋友的密钥

if (session.isOpened()) {
        Session.NewPermissionsRequest newPermissionsRequest = new Session.NewPermissionsRequest(this, "publish_actions");
        session.requestNewPublishPermissions(newPermissionsRequest);
    }

Request request = Request.newStatusUpdateRequest(Session.getActiveSession(), "Join me", new Request.Callback() {
            @Override
            public void onCompleted(Response response) {
                showPublishResult("Result", response.getGraphObject(), response.getError());
            }
        });

        Bundle params = request.getParameters();
        params.putString("message", "hello test 10");
        params.putStringArray("tags", new String[]{id});
        request.setParameters(params);

        request.executeAsync();

The above code only posts on facebook wall without taging the friend whose 'ID' is passed. 上面的代码仅在Facebook墙上发布,而没有标记传递其“ ID”的朋友。

Is there any solution for taging my friend in the post on the facebook wall 有什么办法可以在Facebook墙上的帖子中标记我的朋友

Please suggest if anything wrong in the above code 请建议以上代码中是否有错误

I have tried "tags", "with_tag","tag","to" but nothing seems working. 我尝试了“标签”,“ with_tag”,“标签”,“至”,但似乎没有任何效果。 This is the link from were I have read all the doc facebook dev doc can any one help me with this 这是我已阅读所有文档facebook dev doc的链接,任何人都可以帮助我

You need to specify a place in order to use tags. 您需要指定一个位置才能使用标签。 From: https://developers.facebook.com/docs/graph-api/reference/v2.0/user/feed 来自: https : //developers.facebook.com/docs/graph-api/reference/v2.0/user/feed

tags: Comma-separated list of user IDs of people tagged in this post. 标签:用逗号分隔的用户ID列表,其中包含此帖子中标记的人员。 You cannot specify this field without also specifying a place. 您不能在不指定位置的情况下指定此字段。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM