如何设置一个图标,并使用Facebook的API一个Facebook后添加动作? [英] How to set an icon and add an action in a facebook post using facebook api?

查看:324
本文介绍了如何设置一个图标,并使用Facebook的API一个Facebook后添加动作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Facebook的Andr​​oid的SDK使用如下所示的包来发布消息,在Facebook上。

显示正确的消息,但是图标不显示,我不能找到一个办法得到的东西像下面的图片。

这是正确的方式来设置的图标?

我如何通过CA加入捆绑像获取Spotify的为图像中看到的?

感谢。

 捆绑PARAMS =新包();
params.putString(信息,图标,请);
params.putString(链接,http://www.digital-farm.org);
params.putString(姓名,whip'em);
params.putString(说明,说明);
params.putString(图片,http://lib.store.yahoo.net/lib/yhst-17155638221985/img-twitter.gif); //用于测试
params.putString(图标,http://photos-c.ak.fbcdn.net/photos-ak-snc1/v27562/74/174829003346/app_2_174829003346_2760.gif); //用于测试

mAsyncRunner =新AsyncFacebookRunner(mFacebook);
mAsyncRunner.request(ME /饲料,PARAMS,POST,新PostRequestListener(),NULL);
 

解决方案

其实,你在你的屏幕截图显示该图标可能是Facebook应用程序的图标。它在Facebook的应用程序的配置/设置中设置。当您通过您的Facebook应用程序后,图标会出现自动的。请参阅下面的屏幕截图为例。

假设你正在使用Facebook SDK为Android,当你实例化你的Facebook的对象,你通过Facebook应用程序的ID作为参数传入构造函数。这就是墙上张贴的与您的Facebook应用程序相关联。

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);  

解决方案

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.

这篇关于如何设置一个图标,并使用Facebook的API一个Facebook后添加动作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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