Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>So to give the “alternative” to @Lix’ answer, which focuses on canvas apps, here the analog way for page tab apps:</p> <p>For some reason Facebook decided to do things differently for page tab apps – different than with canvas apps, you can not pass just any GET parameters to your app by appending them to the facebook.com address of your app, but you have to use the <code>app_data</code> parameter for that.</p> <p>You call/link to your app in the form <code>https://www.facebook.com/YourPage?v=app_1234567890&amp;app_data=foo</code> – and whatever you put as value for the parameter <code>app_data</code>, you will find in the <a href="https://developers.facebook.com/docs/reference/login/signed-request/" rel="nofollow"><code>signed_request</code></a> parameter that Facebook POSTs to your app on initial(!) load into the iframe.</p> <p>So you <a href="https://developers.facebook.com/docs/facebook-login/using-login-with-games/#parsingsr" rel="nofollow">parse the <code>signed_request</code></a> (or let f.e. the PHP SDK do that for you), and then you find the <code>app_data</code> value in there. If you want to pass more than one single value, you can f.e. also put JSON-encoded data there – then you have to decode that again after you read the app_data value from the signed request.</p> <p>The docs <a href="https://developers.facebook.com/docs/appsonfacebook/pagetabs/#integrating" rel="nofollow">just shortly mention the <code>app_data</code> parameter</a>, but the principle itself is quite simple.</p> <hr> <p>Now, when it comes to <em>sharing</em> those links, I found that when you use an address in the above form, Facebook tends to cut the parameters from the URL, and treat the whole link as just a link to your Facebook page – it shows the page’s picture and description, and does not even pass your page tab app along, let alone the app_data parameter.</p> <p>I found the most reliable way around this is not to link to your page tab on Facebook directly, but instead to a URL of your own app. When the scraper visits it, you deliver the relevant OG information. And when it’s a real user visiting, you redirect them to your page tab app, passing the data you need via the <code>app_data</code> parameter as described above. Redirecting can either be done server-side (<a href="https://developers.facebook.com/docs/plugins/like-button/#scraperinfo" rel="nofollow">info on how to detect the scraper server-side via its User-Agent header</a>), or client-side via JavaScript (which the scraper does not “speak”).</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload