PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, March 12, 2022

[FIXED] Single Facebook App multiple Client Facebook Page Tab

 March 12, 2022     facebook, facebook-graph-api, facebook-php-sdk     No comments   

Issue

I have created a Facebook Application which will be used as a Facebook Tab Page. My problem is that I am unable to get the page id.

I want to use this single application for multiple Facebook Page Tabs but the content will vary based on the Page Id.

The code I am trying to use to get the signed_request is using the JavaScript SDK.

FB.getLoginStatus(function(response) {
    console.log(response);
})

Solution

This can be done with the signed_request parameter, which is passed on to your URL.

The easiest solution is to use the PHP SDK. It offers a function called "getSignedRequest": https://developers.facebook.com/docs/reference/php/facebook-getSignedRequest

Those are the fields of the signed_request parameter: https://developers.facebook.com/docs/reference/login/signed-request

If you don´t want to use the PHP, you need to parse the parameter on your own. Check out this link for more information and search for "Parsing the Signed Request": https://developers.facebook.com/docs/facebook-login/using-login-with-games

Edit: you will not get the correct signed_request using the JavaScript SDK. Use PHP (or your server language) for this.



Answered By - andyrandy
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing