简体   繁体   English

Facebook的自定义故事,#100对象缺少必需的值……未提供类型为'string'的属性'appnamespace:prop'。”

[英]Facebook custom story, #100 Object Missing a Required Value… property 'appnamespace:prop' of type 'string' was not provided."

For a Custom Story, using user-owned objects (no URL for FB to parse) I defined the custom properties yet I get an error #100... 对于自定义故事,使用用户拥有的对象(没有用于FB解析的URL),我定义了自定义属性,但出现错误#100 ...

here's the code: 这是代码:

FB.api(
  'me/objects/appnamespace:CustomStory',
  'post',
  { object:
    { 
    "title": "story title",    
    "t_name":"watching FOX news",
    "main_a": "custom prop 1",
    "main_b": "custom prop 2",
    "description": "test post tracked trigger"
     }
   },
  function(response) {
    console.log(response);
  }
);

error says appnamespace:CustomStory property main_a not defined which is odd because it's right there... 错误说appnamespace:CustomStory属性main_a未定义,这很奇怪,因为它就在那里...

thanks in advance for ideas... 预先感谢您的想法...

oh.... so the fix is to enclose custom properties in a "data" property that holds an Object ala: 哦....所以解决方法是将自定义属性包含在保存有Object ala的“数据”属性中:

FB.api(
  'me/objects/appnamespace:CustomStory',
  'post',
  { object:
    {"title": "storty title",
    "data": {                      // put custom property values here
        "main_a": "value 1",
        "main_b": "value 2",
        "t_name": "another property"
    },
   "description": "test post tracked trigger"
     }
   },
  function(response) {
    console.log(response);
  }
);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当有效的 src 作为道具提供时,图像缺少必需的“src”属性 - Image is missing required "src" property when valid src is provided as a prop 获取所需类型“String”的错误变量“$name”。 没有提供。 在从 React-Apollo 发出 Graphql 请求时 - Getting Error Variable “$name” of required type “String!” was not provided. on firing Graphql request from React-Apollo 类型“ any []”中缺少属性“ 0”,但是类型“ [{{id:string; gp:布尔值; }] - Property '0' is missing in type 'any[]' but required in type '[{ id: string; gp: boolean; }] 类型中缺少属性,但类型中需要属性 - Property is missing in type but required in type 这个 JSX 标签的 'children' 属性需要一个类型为 'ReactNode' 的子级,但提供了多个子级。 在打印验证错误消息 - This JSX tag's 'children' prop expects a single child of type 'ReactNode', but multiple children were provided. In printing validation error msg Gridsome:错误:所需类型的变量“字符串!” 没有提供 - Gridsome: Error: Variable of required type "String!" was not provided 失败的道具类型道具被标记为必需,但其值为'undefined' - Failed prop type The prop is marked as required but its value is `undefined` 类型“{}”中缺少属性“submitAction”,但在类型中是必需的 - Property 'submitAction' is missing in type '{}' but required in type 失败的道具类型:提供给“TextInput”的“对象”类型的道具“值”无效 - Failed prop type: Invalid prop 'value' of type 'object' supplied to 'TextInput' 道具类型失败:您向表单字段提供了“值”道具。 反应 - 引导 - Typehead - Failed prop type: You provided a `value` prop to a form field. React-Bootstrap-Typehead
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM