发布到打开的图表不会在帖子中显示对象标题 [英] Posting to open graph does not show object title in the post

查看:95
本文介绍了发布到打开的图表不会在帖子中显示对象标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Facebook上创建了一个餐厅应用程序,并创建了一个自定义故事,其行为类型为吃,对象类型为菜。当用户发布到Facebook时,我希望帖子的标题句包含用户选择的菜单的标题,例如:



Bob吃了馅饼在餐厅应用程序



在我发布到Facebook的那一刻,我得到的结果是:



Bob在餐厅应用程序上吃了一道菜。



关于这篇文章的其他一切都按照预期工作。



以下是我使用的代码:

  NSMutableDictionary< FBOpenGraphObject> * dish = [FBGraphObject openGraphObjectForPostWithType:@restaurant-app:dish
title:@pie
image:nil
url:nil
description:@delicious pie ]。

id< FBOpenGraphAction> action =(id< FBOpenGraphAction>)[FBGraphObject graphObject];

[action setObject:dish forKey:@dish];

[FBSettings enableBetaFeature:FBBetaFeaturesOpenGraphShareDialog];


[FBDialogs presentShareDialogWithOpenGraphAction:action
actionType:@restaurant-app:eat
previewPropertyName:@dish
处理程序:^(FBAppCall * call,NSDictionary * results,NSError * error){
if(error){
NSLog(@Error:%@,error.description);
} else {
NSLog(@Success!);
}
}];

我觉得在代码中只是一个简单的错误,但无法弄清楚它是什么是



任何帮助将不胜感激,



谢谢

解决方案

我也有同样的问题。
i得到完美的解决方案尝试这样:





  • 更改一对一 - 没有对象标题类型的故事作为Object来自 Object.noun



例如:Story sentense将如下:



Tejas以示例方式跑步
这里的比赛是我的对象。 / p>



  • 将一对一类型的故事句子保留为 Object.title



例如:Tejas以示例运行race.title。
这里是我的对象。



谢谢,
Tejas


I have created a restaurant app on Facebook and have created a custom story with the action type: "eat", and object type: "dish". When the user posts to Facebook I would like the title sentence of the post to contain the title of the dish that the user has selected, for example:

"Bob ate Pie on Restaurant App"

At the moment when I post to Facebook the result that I am getting is:

"Bob ate a dish on Restaurant App".

Everything else about the post is working as intended.

Here is the code that I am using:

NSMutableDictionary <FBOpenGraphObject> *dish = [FBGraphObject openGraphObjectForPostWithType:@"restaurant-app:dish"
                                                                                        title:@"pie"
                                                                                        image:nil
                                                                                          url:nil
                                                                                  description:@"delicious pie"];

id<FBOpenGraphAction> action = (id<FBOpenGraphAction>)[FBGraphObject graphObject];

[action setObject:dish forKey:@"dish"];

[FBSettings enableBetaFeature:FBBetaFeaturesOpenGraphShareDialog];


[FBDialogs presentShareDialogWithOpenGraphAction:action
                                      actionType:@"restaurant-app:eat"
                             previewPropertyName:@"dish"
                                         handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
                                             if(error) {
                                                 NSLog(@"Error: %@", error.description);
                                             } else {
                                                 NSLog(@"Success!");
                                             }
                                         }];

I feel like there is just a simple mistake in the code somewhere but can't figure out what it is.

Any help would be greatly appreciated,

thanks

解决方案

I had the same problem. i got perfect solution try this:

  • Change the story of the type "One to One - Without Object Title" as "Object" from "Object.noun".

For e.g: Story sentense would be as follow:

"Tejas ran race with sample." Here race is my object.

  • Keep the sentence of story of the type "One to One" as Object.title as it is.

For e.g: "Tejas ran race.title with sample." Here race is my object.

Thanks, Tejas

这篇关于发布到打开的图表不会在帖子中显示对象标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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