How to get Page ID from Facebook Iframe - javascript

After I installed the iframehost app and edited content. The app how to know my page id and render the content successfully. I want to make an app such as it.
My problem is: Assume many users installed my App for their page, but I don't know how to get the page id from different Iframe for each request the page. Please, who can explain how to get page id from iframe when users enter the Facebook page tab.

You can get the Page ID with the signed_request parameter. Here are some threads where this is explained already:
Facebook API get Fanpage ID inside Page Tab
Get Facebook Page Tab ID of current Tab?
how to get facebook page id inside page fan tab using facebook javascript sdk
How can I find out what Page has installed my Facebook App / which page is loading my app

Related

Facebook URL - Angularjs how to get current url

If you are using a page tab on facebook, you can connect other websites inside the iframe. I want to get the url of facebook within the facebook page. when I am trying to get window.location.url, it shows my website url, how to do it in facebook page to get facebook url
You can't. Your Facebook application exists within an iframe, which cannot access the parent window on facebook.com due to same-origin restrictions in all major browsers. It is effectively sandboxed.
However, the Facebook signed request will include the ID of the Facebook Page your tab is being accessed on.

Facebook Page plugin not accepting my page URL

I am trying to do the Facebook page plugin to a site of mine and anytime I enter my page URL, I get this code from Facebook - Error: Not a valid Facebook Page url.
I am copying and pasting the URL right from my profile page. I tried this on several other of my friends pages and I keep getting the same error. I get this error on the Facebook developer page and on my site.
I am using this:
https://developers.facebook.com/docs/plugins/page-plugin
I went to Social Plugins and then Page plugin. I then typed the URL in the Facebook Page URL input field. It is supposed to show a preview of the page plugin, but I continuously only get the error.
What could I be doing wrong?
profile != page
A user profile and a Facebook page are two different things.
The plugin works for pages only, not for user profiles.

How do i create a tab page on facebook where the page is dynamicly generated with a url GET

I have created an app on facebook which uses a page on my website.
The page on my website is generated using a get in the url.
for example https://mypage.com//test.php?k=ccjBGNJSCd
Im having an "intergrate" button which brings up a facebook dialog, like this:
https://www.facebook.com/dialog/pagetab?app_id=345672345&redirect_uri=https://mypage.com/return.php
But I don't know how to send the get code "ccjBGNJSCd" to the tab page.
I can't put it into the app settings because it needs to be dynamic.

How to logout facebook - using code in rails application (Ruby on Rails Omniauth)

I tried to add more than one twitter and facebook accounts from my page via omniauth in rails.
Twitter working fine using force_login parameter.
But, facebook not supporting this.
i can add only one facebook account using /auth/facebook. After i tried to add new facebook account using /auth/facebook path then it returns to my home page only.
If i browse www.facebook.com in same browser then the login page not appearing. The lastly added facebook account page is opening.
when i logout from facebook in browser then i tried /auth/facebook path. its working fine.
So,
need to logout already opened facebook accounts in browser tabs, before i hit add facebook link in my page.
Can anyone help?
thanks.
by deafult, you cannot log in multiple facebook account within one browser unless you have a method to trigger browser(like private browsing-mozilla, incognito Window-chrome ) to let your user sign in. websites uses cookies to track their status.
however, facebook do provide auth_type=reauthenticate.
which the doc is here.
https://developers.facebook.com/docs/howtos/login/client-side-re-auth/
Any correct me if im wrong.

Embedding Facebook Connect In A Facebook Page

Our site allows users to register using Facebook Connect. We also have a Facebook page. We'd like to include the "Connect with Facebook" button in our page so a user could instantly connect (aka register) and then be forwarded on to their account on our site.
I was hoping to use the Static FBML page application and the FBML iFrame tag to simply embed the button but it looks like the iFrame tag isn't allowed in Facebook pages. Facebook Connect uses JavaScript so I'm wondering if there is some kind of trick I could use like popping up a page in a new window that would automatically display the connect dialog box.
Any ideas on how I would include a Facebook Connect button on our Facebook page would awesome!
Thanks in advance for your help.
I think the best method would just be a link back to your site (you could even use the Facebook Connect image as the link) to a custom page that triggers the FB.connect javascript that's needed.
Check here for info about FB.connect.requireSession().

Categories