in Education by
My code cannot display the permission dialog when a user connect to my Facebook application. Instead of the login page, I got a 404 error. My code: require 'src/facebook.php'; require './config.php'; $facebook = new Facebook(array( 'appId' => $fb_app_id, 'secret' => $fb_secret, 'cookie' => true, )); $userData = null; $user = $facebook->getUser(); if ($user) { try { $userData = $facebook->api('/me'); } catch (FacebookApiException $e) { error_log($e); $user = null; } } else { $loginUrl = $facebook->getLoginUrl(array( 'scope' => 'publish_stream', )); }
<?php if ($user): ?> ">Logout <?php else: ?> ">Login with Facebook <?php endif ?>
I have also tried to put directly an personalized URL (like bellow) and I got the same 404 error. $loginUrl = "http://www.facebook.com/dialog/oauth?client_id=".$fb_app_id."&redirect_uri=".$fb_app_url."&scope=publish_stream"; UPDATE 1: Otherwise when I try to Login directly through the server (from http://mydomain/application/index.php), I got a redirection to Facebook website to the URL below and got this error message: https://www.facebook.com/dialog/oauth?client_id=xxxxxxxxxxxxxx&redirect_uri=http://apps.facebook.com/myapplication&state=f8cd945d8a9aefcd0b439fecd8515a68&canvas=1&fbconnect=0&scope=publish_stream UPDATE 2: Here my application configuration: And the message I got when I try to access directly from the app link: apps.facebook.com/myapplication/ without be logged I would appreciate any help. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
The status_update permission you are using in the scope for the loginUrl is not a valid permission. Take a look at the docs. That could be your problem. Also remember, that if a user has already authorized your app, they will not see the permission dialog again on subsequent logins. They will only be taken through the facebook login procedure. EDIT: Take a look at the image I've attached, facebook will on redirect to the url you specify in the site url field in app settings:

Related questions

0 votes
    I get "Login failed error" with the Facebook Android SDK while running on the device. I have done ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 21, 2022 in Education by JackTerrance
0 votes
    I have been using php-sdk to connect to facebook for a while and I never had any problems, but ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    I'm trying to obtain the key hash for integrating facebook into my Android app. But all over the ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 2, 2022 in Education by JackTerrance
0 votes
    I've got a Facebook application, but there is a problem with new users. When using the direct URL ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 2, 2022 in Education by JackTerrance
0 votes
    I have started to receive the following error: OAuth2 specification states that 'perms' should now be called ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 18, 2022 in Education by JackTerrance
0 votes
    I have started to receive the following error: OAuth2 specification states that 'perms' should now be called ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 18, 2022 in Education by JackTerrance
0 votes
    I'm used to v3 node botbuilder sdk so I have a middleware where I look at the dialog stack and ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 24, 2022 in Education by JackTerrance
0 votes
    I'm using this code to merge text with an image and it's working fine. But when I use this code with Facebook app, it ... up output. Here is the code I'm using for Facebook app:...
asked Feb 12, 2022 in Education by JackTerrance
0 votes
    I have a SDI application and I would like to display a dialog after selecting a popup menu item to ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 27, 2022 in Education by JackTerrance
0 votes
    8. Which shortcut key do we use to display Document Properties dialog box? * O Ctrl + F3 O Ctrl + J O Ctrl + C O Ctrl + F5 Select the correct answer from above options...
asked Dec 25, 2021 in Education by JackTerrance
0 votes
    Which Window object method is used to display a message in a dialog box? (a) alert() (b) prompt( ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 23, 2021 in Education by JackTerrance
0 votes
    When I try to open the Plesk Login Page via :8443 I get the Error: ERROR: Uncaught Error: Class ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 10, 2022 in Education by JackTerrance
0 votes
    I am retrieving messages from an Outlook account. I am trying to get inline files and attachments from ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 24, 2022 in Education by JackTerrance
0 votes
    I make a website on php and want to read some information from text file. the reason is if, i ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 8, 2022 in Education by JackTerrance
0 votes
    I make a website on php and want to read some information from text file. the reason is if, i ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 8, 2022 in Education by JackTerrance
...