Passing a parameter to the Facebook Page Tab app

I have this HTML code at this url: https://myapp.herokuapp.com

<html>
<body>
<iframe frameborder=0 border=0 scrolling="no" src="<?php echo $_GET['url']; ?>" width="760px" height="521px"></iframe>
</body>
</html>

I created a bookmark on my Facebook page, and I want anyone to be able to set it on their Facebook page with a different URL. Therefore, when you click on the FB Page 1 tab, the embedded URL1 will be displayed, FB will display URL2, etc. URL is an option when you set the Page tab.

I tried this:

https://www.facebook.com/dialog/pagetab?app_id=XXXXXXXXXX&next=https://myapp.herokuapp.com?url=HERE_YOUR_URL

It installs the application, but it seems that the URL parameter in the iframe is null. What am I doing wrong?

thank

+4
source share
2 answers

My approach is a little different.

URL, , . Facebook Facebook Facebook:

"", signed_request     , .      JSON id ( ) (SOURCE)

, ( $facebook):

$page_id = "";
$sr = $facebook->getSignedRequest();
if($page = $sr['page']) {
    $page_id = $page['id'];
}

$page_id , , , $_GET. Switch - , , , , , , , , .:)

. () , , .

+8

, , . , " " .

:

0

Source: https://habr.com/ru/post/1541053/


All Articles