Facebook SSO not working

I am trying to implement the facebook SSO on an android phone.

The hash key has been generated correctly(i was asked for the password). I have the app page created on facebook.

After taking a build when I put the app on my android phone and try connecting to facebook through it, I get the message "App page is misconfigured. Hit Okay to go back. "

Any suggestions on what could be going wrong here. Or any take on it how I can fix this problem and move ahead with the development.

Below is the code that I have written for the same:
[lua]local widget = require “widget”
require “json”
local facebook = require “facebook”

local appId = “143XXXXXXXXXX7”
print(“khdsfdshnkjfdfdn”)

local onButtonEvent = function (event )
if event.phase == “release” then
print( “You pressed and released a button!” )
facebook.login( appId, listener )
end
end
local myButton = widget.newButton{
id = “btn001”,
left = 100,
top = 200,
default=“fb.png”,
label = “Widget Button”,
width = 150, height = 28,
cornerRadius = 8,
onEvent = onButtonEvent
}

local function onClick( event )
if(event.phase == “release”) then
facebook.login( appId, listener )
end
end

function listener( event )
if ( “session” == event.type ) then
if ( “login” == event.phase ) then
print(“sdfs”)
facebook.request( “me” )
end
elseif ( “request” == event.type ) then
local response = event.response
print(“aaaaaa”)
print( response )
end
end[/lua]

Thanks,

Tarun Gulati [import]uid: 214833 topic_id: 35649 reply_id: 335649[/import]

Being the error says your app page is misconfigured I think that is where you should focus. In your setup on developers.facebook.com the page should have this info more or less.

Basic Info:
Display Name: app name
Namespace: app name, all lower case with no spaces
Contact Email: your email
App Domains: your domain
Hosting Url: N/A
Sandbox: Disabled

Native Android App section:
Package Name: com.yourcompany.yourgame (or whatever your using in build window)
Class Name: com.ansca.corona.CoronaActivity
Key Hashes: your custom key hash or if using Corona’s it would be: JGn9F2vDQ/w6hexLxdefCUpxYIA=
Facebook Login: Enabled
Deep Linking: Disabled
[import]uid: 56820 topic_id: 35649 reply_id: 141761[/import]

Thanks anderoth,

Now after clicking on log in I am getting the following error:

API Error Code: 100
API Error Description: Invalid parameter
Error Message: The parameter message is required.
Kindly suggest whats going wrong here .
Thanks [import]uid: 214833 topic_id: 35649 reply_id: 141764[/import]

If your using the code you posted above, line 37 should be like this. It’s missing a parameter.

facebook.request( "me" , "GET" ) [import]uid: 56820 topic_id: 35649 reply_id: 141782[/import]

You know, I use [text]facebook.request( “me” )[/text] (works both on daily build 990 and 1013 – and I’m sure it works on 971 too), and it returns json object with FB data without a problem. It looks like lacking it defaults to “GET” anyhow:

http://docs.coronalabs.com/api/library/facebook/request.html

I wonder if this is Android specific problem with Facebook API (or Facebook setup.) The code looks straight forward to me…

Naomi [import]uid: 67217 topic_id: 35649 reply_id: 141800[/import]

Yeah, that line is the only one that stuck out from what I use. Mine works on both iOS and Android. I do know the docs almost always refer to iOS and Android can sometimes have slight variations in what is needed. Perhaps this is one of those times.

Surely it won’t hurt to try. :slight_smile: [import]uid: 56820 topic_id: 35649 reply_id: 141809[/import]

Being the error says your app page is misconfigured I think that is where you should focus. In your setup on developers.facebook.com the page should have this info more or less.

Basic Info:
Display Name: app name
Namespace: app name, all lower case with no spaces
Contact Email: your email
App Domains: your domain
Hosting Url: N/A
Sandbox: Disabled

Native Android App section:
Package Name: com.yourcompany.yourgame (or whatever your using in build window)
Class Name: com.ansca.corona.CoronaActivity
Key Hashes: your custom key hash or if using Corona’s it would be: JGn9F2vDQ/w6hexLxdefCUpxYIA=
Facebook Login: Enabled
Deep Linking: Disabled
[import]uid: 56820 topic_id: 35649 reply_id: 141761[/import]

Thanks anderoth,

Now after clicking on log in I am getting the following error:

API Error Code: 100
API Error Description: Invalid parameter
Error Message: The parameter message is required.
Kindly suggest whats going wrong here .
Thanks [import]uid: 214833 topic_id: 35649 reply_id: 141764[/import]

If your using the code you posted above, line 37 should be like this. It’s missing a parameter.

facebook.request( "me" , "GET" ) [import]uid: 56820 topic_id: 35649 reply_id: 141782[/import]

You know, I use [text]facebook.request( “me” )[/text] (works both on daily build 990 and 1013 – and I’m sure it works on 971 too), and it returns json object with FB data without a problem. It looks like lacking it defaults to “GET” anyhow:

http://docs.coronalabs.com/api/library/facebook/request.html

I wonder if this is Android specific problem with Facebook API (or Facebook setup.) The code looks straight forward to me…

Naomi [import]uid: 67217 topic_id: 35649 reply_id: 141800[/import]

Yeah, that line is the only one that stuck out from what I use. Mine works on both iOS and Android. I do know the docs almost always refer to iOS and Android can sometimes have slight variations in what is needed. Perhaps this is one of those times.

Surely it won’t hurt to try. :slight_smile: [import]uid: 56820 topic_id: 35649 reply_id: 141809[/import]