Facebook 好友对话框返回“未知方法”错误
所以很多天以来我一直在尝试这个。到处都找不到任何东西。
当我尝试使用 Facebook Android SDK 调用“好友”对话框时,它返回以下错误:
API错误代码:3
API 错误描述:未知方法
错误消息:此显示类型不支持此方法
我在文档页面上没有找到任何内容告诉触摸设备上不允许朋友对话框。我使用以下代码来执行此操作:
Bundle params = new Bundle();
params.putString("id", "brent");
Log.i("In on click", params.toString());
SampleDialogListener());
mFacebook.dialog(TestActivity.this, "friends", params, new SampleDialogListener());
如果不允许,是否有其他方法可以从应用程序内发送好友请求?
So I have been trying this since many days. Could not find anything anywhere.
When I try to call the Friends dialog with Facebook Android SDK it return this error:
API Error Code: 3
API Error Description: Unknown method
Error Message: This method isn't supported for this display type
I didn't find anything on documentation pages telling that friends dialog is not allowed on touch devices. I am using the following code to do this:
Bundle params = new Bundle();
params.putString("id", "brent");
Log.i("In on click", params.toString());
SampleDialogListener());
mFacebook.dialog(TestActivity.this, "friends", params, new SampleDialogListener());
If it's not allowed is there any alternative way to send a friend request from within an application?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
根本问题是 Facebook API 尚未准备好支持所有显示类型,并且无法为移动显示显示好友对话框。您可以做的是更改 Facebook android 库:如果您在打开对话框时使用“popup”显示模式而不是“touch”,并且使用 www.facebook.com 而不是 m.facebook.com,则在对话框中会出现一个正确的窗口。 Facebook 库标准 WebView。
为此,请按如下所示更改 Facebook.java 的对话框函数:
之后,您可能还想从对话框中删除双标题栏。转到 FbDialog.java,并插入类似于 onPageFinished 的内容:
The underlying problem is that the Facebook API is not yet ready for all the display types, and the friends dialog cannot be shown for the mobile display. What you can do is to change the Facebook android library: if you use "popup" display mode instead of "touch" and www.facebook.com instead of m.facebook.com while opening the dialog, a proper window will appear in the Facebook librarys standard WebView.
For this, change the dialog function of Facebook.java as follows:
After that you might want to remove the double title bar from the dialog as well. Go to FbDialog.java, and insert something similar to onPageFinished:
作品。
Works.
本教程有一个在 facebook API 中使用对话框的示例:
This tutorial has an example of using a dialog in the facebook API: