繁体   English   中英

Facebook的:错误的链接被PHP-SDK张贴到墙上

[英]facebook: wrong link gets posted to wall with php-sdk

我有一个带有fangate的pagetab。 在此扇门上,用户可以单击以共享链接。 这是通过php sdk这样完成的:

$facebook = new Facebook(array(
  'appId'  => $fbconfig['appid'],
  'secret' => $fbconfig['secret'],
  'cookie' => true,
));
$message = "Win great prices!";
$wallpost = array(
'message' => $message,
'name' => 'Win Prices',
'link' => 'https://someurl.com/launcher.php',
'description' =>'I took the survey!',
'picture' => 'http://www.someurl.com/images/logo.png'
);

try
{
    $facebook->api('/me/feed/','post',$wallpost);
    }
    catch(Exception $e)
    {
   //
    }

launcher.php仅包含带有“?ref = ts”的pagetab转发,以使其可用于移动浏览器,例如:

<?php
header('Location: ' . "https://www.facebook.com/myGreatPage?sk=app_45532543674737&ref=ts");
?>

但是:链接,即得到发布, https://someurl.com/launcher.php ,但链接到pagetab https://www.facebook.com/myGreatPage?sk=app_45532543674737 ,这是不工作移动设备(如果他们单击)。 Facebook似乎会自动过滤/更改链接。 我能做什么? 我想念什么吗?

好吧,现在我知道我的错了。 它不是包含链接的“链接”字段。 它的论点

'actions' => json_encode(array('name' => 'Vote for your team','link' => 'https://blimfb.de/golfclub/app2launcher/index.php'))

那不见了。 所以我的数组必须看起来像

$wallpost = array(
'message' => $message,
'name' => 'Win Prices',
'link' => 'https://someurl.com/launcher.php',
'description' =>'I took the survey!',
'picture' => 'http://www.someurl.com/images/logo.png',
'actions' => json_encode(array('name' => 'I took the survey!','link' => 'https://someurl.com/launcher.php'))
);

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM