我有一个带有fangate的pagetab。 在这个fangate上,用户可以单击以共享链接。 这是通过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只包含转发到pagetab的"?ref = ts"使其可用于移动浏览器,例如:
<?php
header('Location: ' . "https://www.facebook.com/myGreatPage?sk=app_45532543674737&ref=ts");
?>
但: 发布的链接不 https://someurl.com/launcher.php,但指向页面框https://www.facebook.com/myGreatPage?sk=app_45532543674737的链接,如果他们点击它,则不能用于移动设备。 Facebook似乎自动过滤/更改链接。 我能做什么?我会错过什么吗?
答案 0 :(得分:0)
好的,现在我知道我的错。 它不是包含链接的&#34;链接&#34; -field。 它的论点
'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'))
);