While you are developing Facebook application you sometimes need to pass data to the application. As a matter of fact iFrame cannot access data from the parent window. Hence you cannot access certain parameters from the URL using $_GET as a usual process.

Facebook provides a way to pass certain data from Parent window to your iFrame application. All you have to do is encode your data into JSON format and pass it into the parent windows URL. This data will be available in the form of JSON string within the iFrame – Cool ? Now let’s see how we do this all –

Notice the URL and you will find that at the end app_data has a JSON encoded string. This is what we are going to receive in the iFrame with the Signed Request of Facebook.


Use the following code to decode it into the PHP array and use this data as per your requirement.

if (is_object($signed_request) && !empty($signed_request->app_data))
    $app_data = json_decode($signed_request->app_data, true);

Hope that helps.

Stay Digified!!
Sachin Khosla

Share this post: