iOS - Facebook Open Graph API - 在用户生成的图像旁边显示字幕 [英] iOS - Facebook Open Graph API -- Getting captions to show up next to user generated images

查看:137
本文介绍了iOS - Facebook Open Graph API - 在用户生成的图像旁边显示字幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法获得用户生成的照片的标题,例如:





相反,这是一个非用户生成的照片,标题和描述: p>



启用用户生成的照片(通过



< img src =https://i.stack.imgur.com/7qEXH.pngalt =消息字段>


允许用户写一个附加到此操作的个性化消息。只有当用户输入文本时,才能使用此文件,而不是预填充。您可以使用提示标记直接提及用户和页面。


此外,在本教程的iOS代码(objective-c)中
https://developers.facebook。 com / docs / tutorials / ios-sdk-tutorial / publish-open-graph-story /



在这种方法中:

   - (void)postOpenGraphActionWithPhotoURL 

设置此属性:

  action.message = @您的消息在这里; 

给出了所需的结果。


I cannot get a caption to show up on a user-generated photo, like so:

Instead, this is a non-user generated photo,with a title and description:

after enabling user-generated photos (via iOS - Facebook Open Graph Api -- ensuring that photos are user generated ), it looks like this:

note- on the image above, both title and description are set just as in the first image. However, the description does not show up. The title, on the other hand, does.

After setting the title to empty, this is the result:

Open graph object on the web is like so:

  <meta property="fb:app_id" content="<?php echo strip_tags($_REQUEST['fb:app_id']);?>">
  <meta property="og:url" content="<?php echo strip_tags(curPageURL());?>">
  <meta property="og:type" content="<?php echo strip_tags($_REQUEST['og:type']);?>">
  <meta property="og:title" content="<?php echo strip_tags($_REQUEST['og:title']);?>">
  <meta property="og:description" content="<?php echo strip_tags($_REQUEST['og:description']);?>">
  <meta property="og:image" content="<?php echo strip_tags($_REQUEST['og:image']);?>">
  <meta property="fb:explicitly_shared" content="true">

What do I need to do in order to get the caption to show up alongside having a user_generated, full size image? Maybe something is configured incorrectly on facebook? Meal is a predefined object defined by facebook. Should I try using another one?

解决方案

It's not a caption, it's a user message.

You need to set the message in your code and in settings as a field as described in https://developers.facebook.com/docs/opengraph/using-actions/

Allows users to write a personalized message attached to this action. You can only use this when the text is entered by the user and not pre-populated. You can mention users and pages inline using mention tagging.

Furthermore, in iOS code (objective-c) from this tutorial https://developers.facebook.com/docs/tutorials/ios-sdk-tutorial/publish-open-graph-story/:

In this method:

- (void)postOpenGraphActionWithPhotoURL

setting this property:

action.message = @"your message here";

gives the desired result.

这篇关于iOS - Facebook Open Graph API - 在用户生成的图像旁边显示字幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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