Link to Facebook Fanpage Iframe - php

I have a problem with my fanpage. A gallery script is running a my webspace and i put it in the app also in th iframe of the Fanpage. The gallery script has get an Share button to post the photos on facebook. This part of it is running fine but when i clicked the link that was posted in Facebook i had been reffered to my page on my webspace and not to the iframe with the webpage and the photo. Is it possible to edit the link to go to this page in facebook iframe?

This is not a problem in general. You can try to redirect your website into the Facebook tab application my checking the HTTP_REFERRER and the url. You might have a look at this example
There is an URL you can try to call and see if you get redirected to the right application. Additionally, you can add app_data-parameters to the URL to identify the real target into your app.
All that can be done by the following code:
// set the target facebook page name and id to perform a forceRedirectToTab()
$tmpFbHelper
->setPageName($iniHandler->getIniSetting('facebook.'.fbHelper::getAppNamespace().'.page.name'))
->setPageId($iniHandler->getIniSetting('facebook.'.fbHelper::getAppNamespace().'.page.id'))
->setSecret($iniHandler->getIniSetting('facebook.'.fbHelper::getAppNamespace().'.secret'));
// perform a redirect to the facebook tab application if someone opens the url out of facebook
// the facebook-linter is not affected by this :)
$tmpFbHelper->forceRedirectToTab();
// perform a deeplink if for example a special url is called or you identify some app-data
$tmpFbHelper->performDeeplink();
You will have to look at your published links into the stream so that the PHP-code finds out that you will redirect and deeplink!
I hope this ideas might help you :)

Related

facebook api - retrieve all tagged friends photos

I'm never used facebook api yet I saw on a blog a piece of code I could use for. It retrieves all tagged photos of our friends and downloads them.
http://www.shelldaemon.com/2014/01/bypass-facebook-photo-verification.html
Yet it is not working since I login, accept the app permissions and it takes me to the login page again. Is there any problem in the code I can fix? I know about php, yet I don't know anything about facebook api.
It would be awesome if someone can see what's the problem.
Thanks in advance.
Which login pages does it take you back to? The Facebook login page or your custom login page? In fact the custom login page would be great since the flow of the app is:
Custom login page on local webserver => Facebook-App login page => Download your friend's tagged photos => Custom login page again.
Maybe the code is working but the part where the app is supposed to download is skipped because of missing file permissions (write-permissions to your destination folder) e.g.?
Did you try to inspect what is going on in your browser after you logged in and before you are redirected to the login page again? With Firefox and Chrome you can inspect the website / web application and look at the console there for errors.
You could also try to add some debugging information during download (e.g. add an "echo 'friendname'" into the download-loop.
Hope that helps!

need to create a Facebook tab for the mobile app

I am having Google Play link(Android) and iTunes App Link(iTunes). I want to create a Facebook tab for my business page and on click of Facebook tab, my Google Play link can be opened.
I have registered myself on developers.facebook.com/apps and created a new App. Now Under Basic Info I get confused on what to enter the value for App Domains so I have entered play.google.com because my Google Play link starts with this.
Now under Page Tab, I have entered all the required information but entered probably the wrong value for Page Tab Edit URL . So I finally save my application but it is not working.
So now I have deleted my Page Tab section and I then switched over to App on Facebook section where under Canvas URL I have placed my Google Play URL with all the required details and then submitted for review.
Before I submit for the review finally it asked me that there should be no external URL used But I have used my Google Play URL in the Canvas URL section which is external.
I am completely confused now with this Facebook. I have also Googled a lot but with no result for me.
Please Guide me on integrating Android link(play.google.com) as Facebook Business Page tab.
Thanks !
I have solved this issue by using static iframe facebook application
What I did is simply created my desire page in HTML and placed it on my server and by static iframe facebook App, I called this page into IFrame.
Problem solved !

Facebook registration plugin redirect

I have facebook application on fan page and use registration plugin which connected to my system, registration form display in canvas of FB, when user sibmited the form he is redirecting to redirect_uri parameter in reg plugin, what should i put to this paramater, to display my redirect page in fb canvas, not in my site.
For example i have redirect parametr http:\\mysite.com\success_registration.php with content text thanks for registartion and i wona display it in fb canvas... now it`s displaing like normal site page, but i dont wona see it so. User should stay in FB app canvas.
How can i solve such problem?
Thanks, Anton.
Try app.facebook.com/[your app name]/success_registration.php
Make sure success_registration.php is in the folder specified in the setup for the app on your server (along with index.php usually)

Facebook php SDK /me/feed posting link and not have the link go through the app, but straight to the page

Built a custom app that will allow users to add jobs to a system. Once they've done that, it should post to their profile pages as well as their news feed. All of this is working perfect, except for one bit. If somebody else clicks on that link, let's say a friend of the person who has posted the link (from the system when adding a job) they're asked to install the app.
What should happen is a new tab should open with that position showing. If you use facebook like / recommend, this works, but requires the user to do it manually. When using the custom facebook app to do it via /user_id/feed, POST it shows the link and everything working fine, till one of their friends clicks on the link and is then requested to install the app.
How can I make so that the link being posted on the fan page, profile page of the user who has given permission to the app to do so, to just open in a new tab and go directly to the link that was posted instead of routing through the app?
Just to add on to this, the url that get's created via the app looks like this : http://www.facebook.com/connect/uiserver.php?app_id=142332219213134&method=permissions.request&redirect_uri=[the actual url being passed]&response_type=code&display=async&auth_referral=1
This makes that you HAVE to install the app to view the links... which should not happen, you should just be taken straight to the link that was shared via the app.
It looks like you probably have Authenticated Referrals enabled. I haven't worked with this feature but it sounds like it's related to your problem based on that URL.
https://developers.facebook.com/docs/opengraph/authentication/#referrals

Oauth dialog redirection php in Facebook. How to redirect to app page

I am developing a Canvas application in Facebook in php. When the user allows the permission it's redirected to my site, as the say in the help page https://developers.facebook.com/docs/reference/dialogs/oauth/.
But I don't want to be redirected to my site, I want to be redirected to the facebook page which contains my site in an iframe. How can I do this? It should be quite straightway.
If the user clicks "Allow", they will be directed to
http://www.example.com/response#access_token=...& expires_in=3600
If the user clicks "Don't Allow", they will be directed to
http://www.example.com/response?
error=access_denied&
error_description=The+user+denied+your+request.
I don't want to go to example.com but to facebook.com/app/ID_APP which contains example.com
EDIT:
after Floyd Wilburn's answer, I tried to put my app page but it doesn't work. It gives me an error. While the right URL looks like this
https://www.facebook.com/dialog/permissions.request?app_id=53434949999999&display/=page&next=http%3A%2F%2Fwww.example.com%2Fapp%2F%3Fnext_url%3Dhttp%253A%252F%252Fapps.facebook.com%28403a2224870942%252F&response_type=code&fbconnect=1&perms=email%2Cread_stream
(we can see the my site url example.com encoded with a parameter 'next_url' to which the user will b redirected from my site page)
the URL of the wrong way looks like this (Just changin my site to my facebook app url )
https://www.facebook.com/dialog/oauth?client_id=185340534870942&redirect_uri=http%3A%2F%2Fapps.facebook.com%2F534349499999s992%2Fhello.php
So my solution is what I commented. The user gets to my site and is redirected to the facebook app URL.
Anyone can guess why Floyd Wilburn's solution doesn't work for me?
Thanks
Just set the redirect_uri parameter to point at http://apps.facebook.com/yourapp/somepage and it will go there instead.

Categories