2017-08-03 68 views
-1
   FB.ui({ 
       method: 'feed', 
       type: 'video', 
       caption: text, 
       link: url, 
       description: text, 
       source: url, 
       picture: pictureEncode 
      }, function(response){ 
       if (response && !response.error_code) { 
        console.log("OK: "+JSON.stringify(response)); 
       } else { 
        console.log("Not OK: "+JSON.stringify(response)); 
       } 
      }); 

我试图从我的视频中分享YouTube视频并且它正在工作。但我需要确定用户是否取消了视频共享。在回应中我没有得到任何有用的价值。他们如下所示。未提供任何详细信息的Facebook API共享响应

构造 : 功能对象() hasOwnProperty : 函数hasOwnProperty() isPrototypeOf : 功能isPrototypeOf() propertyIsEnumerable : 功能propertyIsEnumerable() 的toLocaleString : 功能的toLocaleString() toString : function toString() 的valueOf : 功能的valueOf() defineGetter : 功能defineGetter() defineSetter : 功能defineSetter() lookupGetter : 功能lookupGetter() lookupSetter : 功能lookupSetter() 得到 : 功能() 设置 : 功能()

所以请帮助我这个找出这个问题。谢谢

+0

看到我的回答如下。请问为什么你需要知道他是否取消了?我在答案中加入了一些重要的信息。 – luschn

+0

我想获得回叫是用户分享了视频或者他取消了。 –

回答

2

https://developers.facebook.com/docs/sharing/reference/feed-dialog

看一看的响应参数,还有一个重要的文字:

... POST_ID需要您的应用程序已授予publish_actions,并 用户共享到他们的时间表或一个组。

post_id只会在共享后的响应中,如果用户授权应用程序publish_actions


请务必阅读的平台策略也一样,你不能激励用户在他们的墙上(奖励,门内容)分享的东西:

4.5只激励一个人登录到您的应用,在 上输入促销,或在某个地点办理入住手续。不要激励其他 行动。

来源:https://developers.facebook.com/policy/

+0

感谢您的意见。我发现我需要从应用程序的用户获取“publish_actions”。但如果我使用publish_actions,获得批准Facebook方面并不容易。所以我找到了另一种方式来做到这一点。我用另一个字段叫做display:'popup',。如果用户取消或关闭该弹出窗口,将会出现未定义的回调,如果用户分享了该视频,则会有响应。再次感谢你 –

相关问题