Facebook registration plugin redirect - php

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)

Related

Facebook PHP SDK login in page tab

For start here is whats i'm using : Codeigniter 3 and darkwhispering/facebook-sdk-codeigniter who is a facebook sdk library for codeigniter.
To login with facebook on my app I generate a login url and I redirect the user on this url. It works fine on local and also on my website.
The issue is when a add my app on a facebook tab using this url :
https://www.facebook.com/dialog/pagetab?app_id=myid&redirect_uri=https://myurl.url/
I see my app on a page tab but when I try to click on the login url inside the iframe I get a blank page and there is this message on the javascript console :
Load denied by X-Frame-Options: https://www.facebook.com/v2.6/dialog/oauth?client_id=xxxxxxx&state=xxxxxxxx&response_type=code&sdk=php-sdk-5.4.4&redirect_uri=https://myurl.url/&scope=email does not permit framing.
I understand that facebook block there website to show inside an iframe but I don't understand how I login with the Facebook PHP SDK inside an iframe then ?
Any Idea ? Thanks !
I understand that facebook block there website to show inside an iframe but I don't understand how I login with the Facebook PHP SDK inside an iframe then ?
You need to open the login dialog in the top window instance.
target="_top" if you are using a link to trigger login, resp.
top.location.href="…" if you are redirecting there using JavaScript.
Or, you embed the JS SDK, and use FB.login - that makes for a much nicer user experience, because it does not need to redirect away from the current Facebook page, but will show the login dialog in an overlay.

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 !

Link to Facebook Fanpage Iframe

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 :)

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