I want to use dynamic URL for Facebook page tab for that purpose i want to need secure page tab URL different for every user how can i do this can any body help me?
Dynamic URLs per Page are impossible, it´s just one setting. You can get the Page ID though: https://developers.facebook.com/docs/php/howto/example_access_token_from_page_tab/ (see $helper->getSignedRequest())
Fields in signed_request: https://developers.facebook.com/docs/reference/login/signed-request
More information: how to read facebook signed_request to get user_id
Related
I have created a facebook application. Using php code to adding a tab in the Facebook page. And I want to change 'Secure Page Tab URL' for tab on the same App but I don't know how to do it!
Example:
tab A -> Secure Page Tab URL A / tab B -> Secure Page Tab URL B
Does any one have an idea about this? thanks!
You can only have one Secure Page Tab URL per App. If you want to show different content on different Pages, you have to parse the signed_request POST parameter to get the Page ID - and show different content depending on that ID.
More information: https://developers.facebook.com/docs/games/gamesonfacebook/login#parsingsr
Btw, it is not possible to add one App several times to one Page, just in case that´s what you want to achieve.
i got a problem here. On my site i have a facebook share button, but it sends a link with some get variables. So im guessing facebook just handles these as $_GET['blabla'] but i want that link to be shared.
Currently the link to be shared is:
http://www.EXAMPLE.com/wptest/?page_id=38&vodid=1&t=152
so the link is:
http://www.facebook.com/sharer/sharer.php?s=100&p[url]=www.EXAMPLE.com/wptest/?page_id=38&vodid=1&t=152
But facebook only shares:
http://www.EXAMPLE.com/wptest/?page_id=38
how to i get my url so facebook (and other sites) treat the whole thing as a link instead of just filling the get array?
What you should do is URL encode the link before going to the sharer.php link, so the link you should use is:
http://www.facebook.com/sharer/sharer.php?s=100&u=http%3A%2F%2Fwww.example.com%2Fwptest%2F%3Fpage_id%3D38%26vodid%3D1%26t%3D152
i.e.
http://www.example.com/wptest/?page_id=38&vodid=1&t=152 becomes http%3A%2F%2Fwww.example.com%2Fwptest%2F%3Fpage_id%3D38%26vodid%3D1%26t%3D152
If you look at the above example, you'll see that the Facebook Sharer page will correctly display the URL in the dialog:
I've seem to have run into an issue here.
I have a voting/gallery app on a Tab of a specific page on Facebook.
So to provide a user with a direct link to a image in a Gallery(in the Paget Tab App), i generated a URL with APP_DATA, so I can pass data(image filename)to the iframe.
So basically my links look kinda like this:
https://www.facebook.com/pages/xxxxxx/xxxxxxxxx?sk=app_xxxxxxx&app_data=showimage.php%3Ffilename%3D1336314789stevakralj%2Ejpg
Now, when I try to create a Like button for this Link, I get nothing.
Any ideas?
I have exactly the same problem... In my app, which is hosted by a page tab, the "Like" buttons for each item apper correctly and the "data-href" attribute for each "like" button has the same format as yours, but EVERY like button points to the Facebook page which hosts the app, not to the individual item... so, for every item in my gallery, the "like" information under it is exactly the same (number of likes for the page hosting the app) and if I "dislike" any item, I "dislike" the entire page.
I have tried the same format but the parameter NOT on a facebook page... then it works... I don't see a difference but:
https://www.facebook.com/pages/xxxxxx/xxxxxxxxx?sk=app_xxxxxxx&app_data=abc (DOESN'T WORK, for each item which have app_data different)
https://www.mytestweb.com/test.aspx?sk=app_xxxxxxx&app_data=abc (WORKS for each item which have app_data different)
Facebook doesn't seem to allow linking directly to a tab page so strips your app ID from the URL. There's no way to get around this except by linking to an external site that bounces back to Facebook.
I'm creating a site utilizing PHP that draws data from a mySQL database. The content that is drawn is constantly changing and linked to a unique ID. Although a lot of content is pulled on a main page, each facebook-send button links to the contents unique ID on a separate page. I'm passing the information through the URL in the facebook send (ie. link: www.example.com/info.php?id=5 )
My problem is that the send button is not recognizing the Open Graph Meta tags for the page - it displays the wrong picture and wrong title. I've tested with the debugger - and it works for the receiving page (www.example.com/info.php), but not with the added data. That said, once I plug in the full URL with data (www.example.com/info.php?id=5) into the debugger - that page gets crawled & all send buttons linking to that exact URL now populate with the correct picture and title.
Because the content on my site is constantly changing I can't manually have facebook crawl each page of potential URLs with each data ID. Is there a way I can pass data through the URL and have facebook-send button recognize the Open Graph Meta Tags on the receiving page to display for every potential ID? Note: it's just one picture and title I want for all links.
I thank you in advance for your time, I'm slightly new to programming and your help is sincerely appreciated!
We do a lazy crawl, so the first person to Send might not get the image right away, but if you wait 30 seconds and try again it should show up.
Let's say I have a URL: http://example.com/person/list
This website will display a list of people. The list of people get very long, so eventually I build in pagination. Let's say 10 people per page. The URL looks something like this:
http://example.com/person/list?page=2
If I click the next page link, I will be taken to page 3:
http://example.com/person/list?page=3
This is good because if I copy and paste the URL to a friend, she will be directed to page 3 immediately.
Let's say that I now incorporate AJAX, and the page requests are ajax calls using jQuery. The original URL is http://example.com/person/list and when a user clicks on the next page link, the URL in the address bar doesn't change.
This is bad because if I'm on page 3, the URL in the address bar doesn't reflect this anymore.
There are multiple jQuery history plugins which will change the URL, however, these will ONLY change the portion of the URL which is after the hash mark #. Information after the hash mark is not sent to the server.
If I'm using a history plugin, the URL can be changed to http://example.com/person/list#page=2
My problem with this approach is: If someone copies and pastes this URL to a friend, when the friend requests this URL, I have no idea which page the user is intending to look at. Therefore, my best approach is to load all of the people entries onto the page, and have javascript select which page to display based on the information after the hash mark. This is a problem because I started to paginate the pages to reduce the amount of information being pulled back from the server in the first place!
What options do I have, such that I can have the back button be usable with Ajax, but also have bookmarkable links which do not require me to get all info from the server.
As I recently learned from my question you have to check the hash-part of the url after the 'friend' opened the link and fetch the content using ajax.
Or you can rewrite it on the server-side to http://example.com/person/list?page=2
You could not list anything until the page loads and then have ajax load the appropriate page.
Another option would be to load the first page as normal and then have javascript check the page hash to load the appropriate page.
For very small loads (and I assume loading 10 people is 'fast'), the second option is probably the best as it shouldn't cause too much disruption of the UI.
Option one has a downside as far as SEO goes, as search engines won't index the content if it's not loaded.