最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Facebook custom story share using JavaScript sdk() showing error(Action Requires At Least One Reference) - Stack Overflow

programmeradmin4浏览0评论

I am using JavaScript sdk for one of my Facebook canvas game application. I am trying to implement custom story share dialog to post story on user wall.

The information available on developer site is unclear and limited.The bellow code is for sharing custom story using open grap API. Bellow code is available on Facebook developer site link provided(). The Facebook provided code is working fine as its using predefined action_type.

FB.ui({
   method: 'share_open_graph',
   action_type: 'og.likes',
   action_properties: JSON.stringify({
   object:'/',
    })
  }, function(response){});

I have create an object(cricket) and action(play) for custom story on FB Developer console App's Open Graph tab.i have created a self hosted Object(html page) called cricket.html.Bellow is the content or my html page.i verified the html page on Open Graph Object Debugger.Graph Object Debugger showing me all the information, what i have given with no errors or warnings .

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta property="fb:app_id"          content="*************" /> 
<meta property="og:type"            content="appnamespace:cricket" /> 
<meta property="og:title"           content="App for u" /> 
<meta property="og:url"               content=".html" /> 
<meta property="og:description"     content="Find me on facebook for u" /> 
<meta property="og:image"           content=".png" /> 

</head>
<body>
</body>
</html>

Bellow is my code where I am replacing:- og.likes ---to--->appnamespace:play("play"is my action).

Is i am doing any thing wrong here ? please let me know.

function customshare()
{
FB.ui({
method: 'share_open_graph',
action_type: 'appnamespace:play',
action_properties: JSON.stringify(
{
  object:'.html',
})
},
 function(response){});
 }

However i am getting the below error while executing the FB.ui method: 'share_open_graph' for custom share.

I am using JavaScript sdk for one of my Facebook canvas game application. I am trying to implement custom story share dialog to post story on user wall.

The information available on developer site is unclear and limited.The bellow code is for sharing custom story using open grap API. Bellow code is available on Facebook developer site link provided(https://developers.facebook./docs/sharing/reference/share-dialog). The Facebook provided code is working fine as its using predefined action_type.

FB.ui({
   method: 'share_open_graph',
   action_type: 'og.likes',
   action_properties: JSON.stringify({
   object:'https://developers.facebook./docs/',
    })
  }, function(response){});

I have create an object(cricket) and action(play) for custom story on FB Developer console App's Open Graph tab.i have created a self hosted Object(html page) called cricket.html.Bellow is the content or my html page.i verified the html page on Open Graph Object Debugger.Graph Object Debugger showing me all the information, what i have given with no errors or warnings .

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta property="fb:app_id"          content="*************" /> 
<meta property="og:type"            content="appnamespace:cricket" /> 
<meta property="og:title"           content="App for u" /> 
<meta property="og:url"               content="https://example./appnamespace/cricket.html" /> 
<meta property="og:description"     content="Find me on facebook for u" /> 
<meta property="og:image"           content="https://example./appnamespace/image/any_time_share.png" /> 

</head>
<body>
</body>
</html>

Bellow is my code where I am replacing:- og.likes ---to--->appnamespace:play("play"is my action).

Is i am doing any thing wrong here ? please let me know.

function customshare()
{
FB.ui({
method: 'share_open_graph',
action_type: 'appnamespace:play',
action_properties: JSON.stringify(
{
  object:'https://example./appnamespace/cricket.html',
})
},
 function(response){});
 }

However i am getting the below error while executing the FB.ui method: 'share_open_graph' for custom share.

Share Improve this question edited Oct 27, 2017 at 12:28 Vadim Kotov 8,2848 gold badges50 silver badges63 bronze badges asked May 31, 2014 at 4:08 DKBHOIDKBHOI 3482 gold badges6 silver badges17 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 5

I got my problem solved by simple changing this:-

object:'https://example./appnamespace/cricket.html',

To

cricket:'https://example./appnamespace/cricket.html',

You need to mention the url in url field of object i guess then only it will work and cricket field is missing as seen from your error message

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论