Hybridauth Facebook display setting not working - facebook

In my website, I have integrated HybidAuth for Facebook Login authentication. I have installed HybridAuth using composer and integrated all required codes as per the document. The login authentication is working and I'm getting the response too. But now it is redirecting to facebook login page in full screen, to overcome this they have a display setting which includes these different settings "page, popup, iframe, touch or wap".
In this, "page" is the default. When I change it to "popup" or "iframe" it is not working.
My Reference Document: https://hybridauth.github.io/hybridauth/userguide/IDProvider_info_Facebook.html
My Code sample:
$configArray = array(
"base_url" => "<< my base url >>",
"providers" => array (
"Facebook" => array (
"enabled" => true,
"keys" => array ( "id" => "<< my app ID >>", "secret" => "<< my app secret key >>" ),
"scope" => ['email', 'user_birthday', 'user_hometown'],
"display" => "popup"
)
)
);
I have installed the latest version and also included required files in my program. I need some help to find a solution to this issue, so I can have the login screen in a pop-up or in an iframe.
Thanks in advance.

Your html button leads to calling hybridauth decides how large the popup window is.
check the tutorial here

I have also posted this question in Github and received the answer for this, Please check this link https://github.com/hybridauth/hybridauth/issues/832
The display option is set to be not applicable in the Hybrid Auth implementation. This option can be used only when we use Facebook SDK for JavaScript.
SO the author removed the Display setting from the documentation and updated the document with this setting.
Thanks for all your answers and helps.

Related

How to set the facebook default audience for the new oAuth 2 dialog

Googling for this i found out there was something called "advanced oauth setttings" in which you could set the default audience for your app (justme/friends/everyone) when the user connects your app. But it is nowhere to be found in the new version of the app settings pages in developer.facebook.com. When I connect to my app, it defaults to "friends". However there are other apps that default to "everybody". How is this done?
Also, looking at the getLoginUrl documentation, I see "scope" and "redirecturi" and some other settings, but here "default audience" is not available as well. (I am using the php-sdk)
return $facebook->getLoginUrl(array(
'scope' => 'email,offline_access,manage_pages,publish_actions',
'redirect_uri' => $returnurl
));
Is it something that is not available any more? Or am i missing something.

Set Default Activity Privacy to public on app install

I've noticed in my last app that it installs with the Activity Privacy set to "Only me" and when the new permissions dialog shows there's no way to change the privacy from there, and this app installs with "Only me" privacy.
I wanted to force the Public value for this app privacy and I don't know how to do it.
I show the permissions dialog using PHP:
$params = array(
'scope' => 'email',
'redirect_uri' => 'https://mytabpage'
);
$loginUrl = $facebook->getLoginUrl($params);
The solution can be found in the bug reported here
As Thomas says here:
After further testing, if the user has NEVER installed the app before, it seems to follow the default activity. If the user HAS USED the app before, and removed it from their profile, when they re-add it, it uses whatever settings they had before.
Hope that helps. If you think otherwise or find any deviation from this theory let me know!

How to upload custom app image (tab_image) for Timeline Page tabs via API?

Facebook released the new Timeline for Pages today. Apps installed to pages as "tabs" now appear above the timeline with a 111px x 74px size thumbnail "app image". You can customize this on a per-page level (just like the custom tab name) if you navigate the Facebook Page admin interface.
You can update the tab's "custom name" via the Open Graph API, but they do not appear to have updated their API docs to show how to upload a custom tab_image (assuming they will). Is it possible now but undocumented? Has anyone figured out how to do this yet?
Updated 2016:
With the latest Open Graph 2.5 API tabs endpoint and PHP SDK 5, the code should look like this:
<?php
$fb = new Facebook\Facebook([/* . . . */]);
$response = $fb->post(
'/{page-id}/tabs',
[
'custom_name'=>'My Custom Tab',
'custom_image_url'=>'http://publicly.accessible/image.jpg',
'app_id'=>'{app-id}',
],
'{page-access-token}',
);
Original 2012 post:
I figured it out, it's just like uploading an image. The field is called "custom_image". Presumably they will update the documentation soon. It's nice they enabled this API hook so quickly with the new release!
Here's how to do it with the Facebook PHP SDK:
<?php
$page_access_token = 'XXXXXXX'; // you'll need the manage_pages permission to get this
$facebook = new Facebook(array(
'appId' => 'YOUR_APP_ID',
'secret' => 'YOUR_APP_SECRET',
'fileUpload' => true, // enables CURL # file uploads
));
$facebook->api(
'/PAGE_ID/tabs/TAB_NAME', // looks like "app_xxxx" where xxxx = APP_ID
'POST' // post to update
array(
'custom_image' => '#' . realpath('path/to/my/file.jpg'),
'custom_name' => 'My App', // give it a custom name if you want too
'access_token' => $page_access_token // access token for the page
)
);
Cheers
As you said Timeline for Pages is just announced and it's too soon to say it'll be possible via API. Currently it's not possible even in settings of your App in Developer Application.
This information is simply not yet documented in help center or Graph API documentation.
It's also way soon to say someone have discovered if such functionality exists...
We all should wait a bit and probably file bugs which may get some response from officials confirming, rejecting or adding this to wish list.

iframe loaded in Facebook page tab: signed_request returning 'profile_id' not 'page'

This is driving me crazy. I know a lot of people are having problems with empty signed_request parameters ... this not one of those questions!
I get the $_REQUEST['signed_request'] data and decode it in PHP without problem. I am using an iframe canvas to create a page tab, one of those 'click like to access more info' pages that are very popular at the moment.
The problem is the signed_request data does not contain a ['page'] field as expect, it contains a ['profile_id'] which is meant to be for "apps written in FBML and loaded in a Page tab" (from https://developers.facebook.com/docs/authentication/signed_request/).
I have checked and checked my settings, it's definitely an iframe canvas. Is anyone else having this problem?!
Example of decoded signed_request data:
Array ( [algorithm] => HMAC-SHA256 [issued_at] => 1320926195 [profile_id] => XXXXXXXXXX [user] => Array ( [country] => au [locale] => en_US [age] => Array ( [min] => 21 ) ) )
I managed to fix this problem by recreating the app. The old app was created a while ago when FBML was still an option, even though I'd changed the settings to iframe it was causing some legacy problem.
Anyway, nuking the app settings and starting again fixed the problem!
I had the same problem but creating another application wasn't an option to me. I started trying different configurations and I managed to start receiving the expected response when I activated the migration option Page Tab iframe
In your application Settings -> Advanced -> Page Tab iframe -> Enabled
You will then receive something like:
{"algorithm":"HMAC-SHA256","expires":0,"issued_at":1334321200,"oauth_token":"AAAAAZAj4rx20B4E3Z5BWYJwyfZATJFE9j0P3AXZAnEum451qFiIXnhCvzmZCFIZCmZCc83JKUsiyhzRSpFDXHEXzmeBIqjHdVxtWI1xNBSCPzwZDZD","page":{"id":"259117083013","liked":true,"admin":true},"user":{"country":"es","locale":"en_US","age":{"min":21}},"user_id":"342"}"

facebook: how to show content in page only if user likes it

how can i show or display information only if the user is fan or likes my page? there are several pages that do that to catch more fans. thanks!
edit:
like the victorias secret page with this box
http://www.facebook.com/victoriassecret?v=app_117241824971601&ref=ts
My answer applies if you use an iFrame for your tab/canvas. First, you need to ask for permissions (just need basic info from user). Then, make a call to the Javascript API, like so:
FB.api('me/likes', function(response) {
});
This gives a JSON object of everything the user has liked. So, you have to loop through the response and try to find your page. If you are successful in finding it, display the awesome content!
Hope this helps!
Edit: Looking back, my answer was way off. This information is actually contained in the signed_request given by Facebook.
If you mean Facebook Page, use functions from Facebook API: Signed Request
$signed = parse_signed_request($_REQUEST['signed_request'], YOUR_APP_SECRET_KEY);
$signed = Array (
[algorithm] => HMAC-SHA256
[expires] => 13..
[issued_at] => 13..
[oauth_token] => ...
[page] => Array (
[id] => 29...
[liked] => 1
[admin] =>
)
[user] => Array ( [country] => cz [locale] => en_US [age] => Array ( [min] => 21 ) )
[user_id] => ..
)
If current user like your Facebook tab page, you find out from $signed['page']['liked']
If you're using the php sdk, you can use a call to the facebook object api and then determine if they have the like you want them to have.
$path = 'me/likes';
$likes = $facebook->api($path);
More info here
This is a privacy and security setting. Facebook Privacy FAQ
Page Tabs gets Signed Request that contain "liked" field
http://developers.facebook.com/docs/authentication/signed_request/
FQL isFan
http://developers.facebook.com/docs/reference/fql/page_fan/
Old REST API isFan
http://developers.facebook.com/docs/reference/rest/pages.isFan/
Legacy FBML isFan
http://developers.facebook.com/docs/reference/fbml/visible-to-connection/
There doesn't have to be any code involved. Just create a landing page (you could create a jpeg photo and link to the photo) and set that as the default landing page in your page settings. For users who are fans they go directly to the wall posts. All other people (non-fans) go to your specified landing page.
By the way, you realize that people can still access your content by just clicking on one of the tabs, correct? Even the Victoria Secrets example allows you to click on the "wall" tab, for example, and see the content.
A lot of people just like the page because it's the default landing page and they "think" they have to like the page first. It's more social psychology than anything else.
Google for Facewall Script, that should do what you want. But keep in mind to offer an option for users that not have Facebook Account.