如何发送使用Facebook的对话在Android上的朋友的要求?朋友、Facebook、Android

由网友(错过的人最难忘)分享简介:我想TOT发送使用Facebook的Andr​​oid SDK的好友请求。我目前使用这种code(这是我从了here):I want tot send a friend request using the Facebook Android SDK. I'm currently using this code (whi...

我想TOT发送使用Facebook的Andr​​oid SDK的好友请求。我目前使用这种code(这是我从了here):

I want tot send a friend request using the Facebook Android SDK. I'm currently using this code (which I got from here):

Bundle parameters = new Bundle();
parameters.putString("APP_ID","USERNAME");
facebook.dialog(this, "friends", parameters, this);

在这里APP_ID是我的应用程序的Facebook的ID和用户名是我想添加的好友的用户名。这将导致以下错误:

where APP_ID is the Facebook ID of my app and USERNAME is the username of the friend I want to add. This leads to the following error:

API Error Code:100
Invalid parameter
The parameter id is required

我想id参数意味着APP_ID。

I thought the id parameter meant the APP_ID.

我已经通过关于对话的 HTTP相关文件不见了.COM /文档/参考/对话框/朋友/ 和的http:// developers.facebook.com/docs/reference/androidsdk/dialog/ ,但仍无法找到答案。

I have gone through the relevant documentation regarding dialogs at http://developers.facebook.com/docs/reference/dialogs/friends/ and http://developers.facebook.com/docs/reference/androidsdk/dialog/, but still can't figure it out.

任何帮助是AP preciated。

Any help is appreciated.

推荐答案

应该是这样的:

Bundle parameters = new Bundle();
parameters.putString("id", USER_ID);
facebook.dialog(this, "friends", parameters, this);

在情况下是一个活动也农具 DialogListener

In case that this is an activity which also implements DialogListener.

,因为它说的文件中:

APP_ID - 您的应用程序的标识。必需的,但自动   大多数的SDK规定。    ID - 必需。的ID或的用户名   目标用户添加为好友。

app_id - Your application's identifier. Required, but automatically specified by most SDKs. id - Required. The ID or username of the target user to add as a friend.

阅读全文

相关推荐

最新文章