如何发送使用Facebook的对话在Android上的朋友的要求? [英] How to send friend request using Facebook dialogs on Android?

查看:153
本文介绍了如何发送使用Facebook的对话在Android上的朋友的要求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想TOT发送使用Facebook的Andr​​oid SDK的好友请求。我目前使用这种code(这是我从了<一个href="http://stackoverflow.com/questions/5372456/facebook-friends-dialog-returns-unknown-method-error">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.

这篇关于如何发送使用Facebook的对话在Android上的朋友的要求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆