如何使用 facebook api 在 facebook 帖子中设置图标并添加操作?
我正在使用 facebook-android-sdk 使用下面所示的捆绑包在 facebook 上发布消息。
该消息显示正确,但未显示图标,并且我找不到获得如下图所示内容的方法。
这是设置图标的正确方法吗?
如何在捆绑包中添加“获取 Spotify”之类的内容(如图所示)?
谢谢。
Bundle params = new Bundle();
params.putString("message", "icon please");
params.putString("link", "http://www.digital-farm.org");
params.putString("name", "whip'em");
params.putString("description", "description");
params.putString("picture", "http://lib.store.yahoo.net/lib/yhst-17155638221985/img-twitter.gif"); //used for testing
params.putString("icon", "http://photos-c.ak.fbcdn.net/photos-ak-snc1/v27562/74/174829003346/app_2_174829003346_2760.gif"); //used for testing
mAsyncRunner = new AsyncFacebookRunner(mFacebook);
mAsyncRunner.request("me/feed", params, "POST", new PostRequestListener(), null);
I'm using facebook-android-sdk to post a message on facebook using the bundle shown below.
The message is displayed correctly, but the icon is not shown, and I can't find a way to get something like the image below.
Is this the correct way to set an icon?
How ca I add in the bundle something like "Get Spotify" as seen in the image?
Thanks.
Bundle params = new Bundle();
params.putString("message", "icon please");
params.putString("link", "http://www.digital-farm.org");
params.putString("name", "whip'em");
params.putString("description", "description");
params.putString("picture", "http://lib.store.yahoo.net/lib/yhst-17155638221985/img-twitter.gif"); //used for testing
params.putString("icon", "http://photos-c.ak.fbcdn.net/photos-ak-snc1/v27562/74/174829003346/app_2_174829003346_2760.gif"); //used for testing
mAsyncRunner = new AsyncFacebookRunner(mFacebook);
mAsyncRunner.request("me/feed", params, "POST", new PostRequestListener(), null);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
实际上,您在屏幕截图中显示的图标可能是 Facebook 应用程序的图标。它是在 Facebook 应用程序的配置/设置中设置的。当您通过 Facebook 应用程序发帖时,该图标应该会自动出现。例如,请参见下面的屏幕截图。
假设您使用的是 Android 版 Facebook SDK,当您实例化 Facebook 对象时,您将 Facebook 应用程序的 ID 作为参数传递到构造函数中。这就是墙贴与您的 Facebook 应用程序关联的方式。
Actually that icon you show in your screen shot is probably the Facebook application's icon. It's set within the Facebook application's configuration/settings. When you post via your Facebook application, the icon should appear automagically. See screen shot below for example.
Assuming you're using the Facebook SDK for Android, when you instantiate your Facebook object, you pass your Facebook application's ID as parameter into the constructor. That's how the wall posting is associated with your Facebook application.