使用新的Facebook SDK for Android将内容添加到Facebook Feed对话框 [英] Adding content to Facebook feed dialog with new Facebook SDK for Android
问题描述
我知道这个线程,与我一样的问题。
但正如在其中一条评论中所说的那样,API被更改为这一个,message属性现在被忽略。有没有办法使用新的API设置文本框内容?
这里是我的代码:
protected void post(){
Bundle params = new Bundle();
params.putString(message,我的消息在这里);
facebook.dialog(this,feed,params,new DialogListener(){
@Override
public void onFacebookError(FacebookError e){
}
@Override
public void onError(DialogError e){
}
@Override
public void onComplete(Bundle values){
}
@Override
public void onCancel(){
}
});
}
Thx。
我也一直在寻找这个,我想我已经找到了解决方案。令人遗憾的是,这是针对iO的文档,可以在这里找到;
Bundle params = new Bundle();
params.putString(link,你的应用程序url这里);
params.putString(picture,你的img url这里);
params.putString(name,你的帖子标题);
params.putString(caption,your subtitle);
params.putString(description,your message);
facebook.dialog(您的上下文,feed,params,您的DialogListener);
不要尝试只使用一个参数,你必须使用它们来使其工作。
希望这可以帮助你。
编辑
截至2011年7月12日,消息标签将被忽略我建议您使用 />
这是Facebook的关于消息参数的引用:
7月12日,我们忽略了Feed对话框中的消息参数,这样就省去了流媒体故事预先填写的能力(Policy IV.2禁止),这种改变鼓励用户与朋友分享真实和相关的内容。
I'm aware to this thread, with same question as my.
but as it says in one of the comments there- API was changed to this one and the "message" attribute is now ignored. is there a way to set the text box content with the new API?
here's my code:
protected void post() {
Bundle params = new Bundle();
params.putString("message", "my message here");
facebook.dialog(this, "feed", params, new DialogListener() {
@Override
public void onFacebookError(FacebookError e) {
}
@Override
public void onError(DialogError e) {
}
@Override
public void onComplete(Bundle values) {
}
@Override
public void onCancel() {
}
});
}
Thx.
I have been looking about this as well and I think I have found the solution. Sadly enough the documentation for this was for iOs and can be found here;
Bundle params = new Bundle();
params.putString("link", "your app url here");
params.putString("picture", "your img url here");
params.putString("name", "your post title");
params.putString("caption", "your subtitle");
params.putString("description", "your message");
facebook.dialog(Your Context, "feed", params, Your DialogListener);
Don't try to use just one parameter, you have to use them all to make it work.
I hope this helps you out.
EDIT
The message tag is ignored as of 12 July 2011 I would advice you to use the "description" tag for what ever message you would like to share.
This is the quote from Facebook about the "message" parameter: "On July 12, we are ignoring the message parameter in Feed Dialogs. This eliminates the ability to pre-fill stream stories (prohibited by Policy IV.2). This change encourages users to share authentic and relevant content with their friends."
这篇关于使用新的Facebook SDK for Android将内容添加到Facebook Feed对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!