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!
Related
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.
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.
I am trying to use Explicit Sharing with built in watch action. Here is my code
$post_action = $facebook->api(
'me/video.watches',
'POST',
array(
'video' => "$post-link",
'fb:explicitly_shared'=>true
)
);
When I set fb:explicitly_shared to false the activity is shown on both recent activity and activity log. But when i set it to true the activity is only shown on activity log, not to the recent activity, not to the users timeline.
I have read all the documentation on Facebook about Explicit Sharing but i cant find out why is this happening.
All the results I mentioned are made with Test Users of this app.
Maybe I have first to submit it on Facebook for approval before I will be able to test it?
After some days of work i found out that Application testers have a bug with explicit share. I tried to post with my developers account and works good!
Hopefully this should be quick and easy.
session_start();
include("facebook.php");
$facebook = new Facebook(array(
'appId'=>'xxxxx50274xxxxx',
'secret'=>'xxxxxb932d62fbc6287feb18e5exxxxx',
'cookie'=>true
));
$fbuser = $facebook->getUser();
if (empty($fbuser)){
$fbloginurl=$facebook->getLoginURL();
echo "<html><body><a href='$fbloginurl'>Click</a></body></html>
} else {
die("Authenticated");
}
In this example, the first time I click the link to give permissions to the app to access my FB account, everything works fine. I can keep refreshing the page, and I get the "Authenticated" confirmation.
However, every time I restart the browser (starting a new session), it doesn't authenticate the app automatically and I have to click the link again. Of course as soon as I click the link I am immediately redirected back to the source page and presented with the "Authenticated" confirmation.
Is there any way of not having to click the authentication link during new browser sessions and have it authenticate automatically? I need to do this without a PHP Header directive, as I want the first time the user gives permissions to the app to be triggered by a manual click.
My FB login is persistent ("stay logged in" option is checked).
Thanks a lot for any help.
If I am understanding your scenario correctly (this is not an iframe app, correct?), this is all down to losing the website session cookie when the browser is closed. Once that cookie is gone, there is nothing to identify the user to your server-side code and so no way to know if the user has previously authorized your app.
You need to find a way to persistently identify the user, or at least identify that he has already given permissions. The simplest way would probably be to set your own (permanent) cookie once the user has first authenticated. Then whenever the session cookie is lost, check the presence of the permanent cookie and if it's there, do a PHP redirect to Facebook (which will be invisible to the user). If there is no cookie, present the HTML link to the user like you are doing now.
Comparing it to my code, the only difference I see is that I check to see if $fbuser is valid - if it isn't send me to the login screen. I'm also using top.location.href.
// Login or logout url will be needed depending on current user state.
if ($fbuser) {
$logoutUrl = $facebook->getLogoutUrl();
}
else {
$loginUrl = $facebook->getLoginUrl(array('scope' => 'publish_actions', 'canvas' => 1, 'fbconnect' => 0, 'redirect_uri'=>config_item('facebook_url').$pf));
echo "<html><body><script> top.location.href='" . $loginUrl . "'</script></body></html>";
exit(0);
}
Hope that helps.
Not sure why this isn't working, and was hoping someone might be able to point me in the right direction.
I have a facebook tab app that should display different content depending on whether a user "likes us or not."
require_once('src/facebook.php');
$app_id = "142214XXXXXXXX"; <--this is correct just hidden
$app_secret = "31275c8895XXXXXXXX";
$facebook = new facebook(array(
'appId' => $app_id,
'secret' => $app_secret,
'cookie' => true
));
$signed_request = $facebook->getSignedRequest();
$like_status = $signed_request["page"]["liked"];
//just for testing (nothing shows up, nor does print($signed_request)
echo "the page is ".$page_id;
if(!$like_status){
echo "Please LIKE US to get this offer or check back on Sept 27";
} else {
echo '<img src="https://www2418.ssldomain.com/frightfurnace/SLOSSbogo.jpg"/><BR />
Printable Page';
}
Now, I know that the SDK is installed and working properly since it does work with the example:
http://www.frightfurnace.com/Facebook/example.php
I have also made sure I am using absolute urls in my Facebook App settings.
I am using
http://www.frightfurnace.com/Facebook/coupon.php
Same with SSL.
Any ideas, kinda stymied. All help appreciated.
Well found the answer in case anyone else needs it.
Go to your apps on Facebook
https://developers.facebook.com/apps/
Go to edit settings
On the left click Advanced
signed_request for Canvas: (Make it enabled)
iframe Page Tab: (enabled)
Under Canvas Settings make sure Canvas Type is
iFrame
Seemed to work for me.
Another thing to check: the tab/canvas url must be EXACTLY the same as required. If there is a redirect to another page, then signed request and other values will not be sent. You can check using a browser sniffer, if a call to the page responds with a 300 (301/302 etc) redirect, then you need to change to what it redirects to.
Examples:
https://example.com/ may need to be https://www.example.com/ (add www., or remove www. depending on how server is set up)
www.example.com/ may need to be www.example.com/index.php (add index.php, or the right page).
Check you are using http:// and https:// correctly in the URLs, and that https:// returns a valid page.