在 Facebook Android 上向朋友发送消息

发布于 2024-12-21 04:47:16 字数 328 浏览 3 评论 0原文

我正在开发一个应用程序,它能够让用户向 Facebook 上的朋友发送消息。我查看了 Facebook API、Hackbook 文件夹。我使用了以下代码,但它不起作用。它似乎要求我为它实现一个新的对话框。

Bundle params = new Bundle();
params.putString("caption", app_name);
params.putString("picture", picture);

dialog(MyClass.this, "send", params, new UpdateStatusListener());

非常感谢任何帮助!

I am developing an application which is able to let a user send a message to a friend on facebook. I have looked at Facebook API, Hackbook folder. I used the following code, but it did not work. It seems to ask me to implement a new dialog for it.

Bundle params = new Bundle();
params.putString("caption", app_name);
params.putString("picture", picture);

dialog(MyClass.this, "send", params, new UpdateStatusListener());

Any help is very appreciated !

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

紫罗兰の梦幻 2024-12-28 04:47:16

检查此片段以张贴在朋友的墙上:

try{
    parameters.putString("message", "Text is lame. Listen up:");
    parameters.putString("target_id", "XXXXX"); // target Id in which you need to Post 
    parameters.putString("method", "stream.publish");
    String  response = authenticatedFacebook.request(parameters);       
    Log.v("response", response);
}
catch(Exception e){}

Check this Snippet for Posting on Friend's wall :

try{
    parameters.putString("message", "Text is lame. Listen up:");
    parameters.putString("target_id", "XXXXX"); // target Id in which you need to Post 
    parameters.putString("method", "stream.publish");
    String  response = authenticatedFacebook.request(parameters);       
    Log.v("response", response);
}
catch(Exception e){}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文