I'm not the greatest programmer so sorry if this is a obvious issue but I really hope someone can help me. I am stumped.
I am trying to make my site run solely over https including a basic php Facebook integration, that captures data from the users profile.
The below code works as expected:
require_once __DIR__ . '/vendor/autoload.php';
$fb = new Facebook\Facebook(['app_id' => '','app_secret' => '','default_graph_version' => 'v2.7',]);
$helper = $fb->getRedirectLoginHelper();
$permissions = ['email,user_location']; // Optional permissions
$loginUrl = $helper->getLoginUrl('http://'.$_SERVER['SERVER_NAME'].'/profile.php', $permissions);
echo '<a href="' . htmlspecialchars($loginUrl) . '">Facebook!</a>';
However, changing the line:
$loginUrl = $helper->getLoginUrl('https://'.$_SERVER['SERVER_NAME'].'/profile.php', $permissions);
Returns the error:
"Can't Load URL: The domain of this URL isn't included in the app's domains. To be able to load this URL, add all domains and subdomains of your app to the App Domains field in your app settings."
I have all the same settings for HTTPS and HTTP in Facebook app settings and the Facebook log in settings. I can't work it out...