0

是否可以使用 facebook android SDK 以“-感到兴奋、阅读、观看”等方式将帖子发布到用户的墙上?我在文档中搜索,但没有找到任何方法。

我以这种方式发布状态:

mFacebookCallback = new FacebookCallback<LoginResult>() {
        @Override
        public void onSuccess(LoginResult loginResult) {
            Toast.makeText(mContext, "in LoginResult on success", Toast.LENGTH_LONG).show();
            /* make the photo share call */
            Bundle postParams = new Bundle();
            postParams.putString("name", "test data");
            new GraphRequest( AccessToken.getCurrentAccessToken(),
                  "/me/photos",  //photos
                  postParams,
                  HttpMethod.POST,
                  new GraphRequest.Callback() {
                  public void onCompleted(GraphResponse response) {
                     Toast.makeText(getApplicationContext(), "Successfully share post", Toast.LENGTH_SHORT).show();
                      }
                    }
            ).executeAsync();
      }
};

有人知道方法吗?

4

1 回答 1

1

最后我找到了一个解决方案。没有用于情绪的 API。但我发现了一个非常有用的表情键盘。此键盘不使用 Unicode 序列,而只是使用本地图像资源。使用支持的 Unicode 序列以及Visual Unicode 数据库,我们可以设置 的 Unicode 表示在此处输入图像描述,是 '\ud83d\ude03',并且可以将此代码添加到我们的帖子状态中,例如:

EditText messageInput = (EditText) findViewById(R.id.input);
messageInput.getText().append("\ud83d\ude03");

所以我可以在我的 Facebook 帖子中添加情感,如下所示:

Bundle postParams = new Bundle();
postParams.putString("message", shareEditText.getText().append("\ud83d\ude01").toString());

这个stackoverflow链接很有帮助。

于 2016-02-07T06:28:57.363 回答