Facebook integration built into our app was mostly working fine until I tested it on a phone with the facebook app installed then login simply fails.
I can repeat this issue really easily:
FAILS:
Install facebook app and click the facebook login button from our home screen, the phone switches to the facebook app, appears to do a bit of thinking then switches back to our app but the event.phase is login_failed.
SUCEEDS:
Uninstall facebook app and click the facebook login button from our home screen, the phone switches to the browser at the facebook page, which either makes you login and do the permission thing or else says “you’ve already given permission etc”, either way after clicking okay it switches back to our app and reports successful login which subsequently allows posts and friends retrieval etc.
I initially, naturally, thought it was our code but subsequently took the code from the documentation and experienced the same symptoms. I then modified it slightly as below to show some alerts with debug info (the function, “fbButtonTapped” is attached to the button tap event and I replaced the fb app id with the correct one).
[lua]local facebook = require “facebook”
– listener for “fbconnect” events
local function listener( event )
if ( “session” == event.type ) then
– upon successful login, request list of friends
if ( “login” == event.phase ) then
native.showAlert(“FB DBUG”, “login success”, {“OK”})
facebook.request( “me/friends” )
else
native.showAlert(“FB DBUG”, “login failed! RESPONSE: “…event.response…”|| PHASE:”…event.phase, {“OK”})
end
elseif ( “request” == event.type ) then
– event.response is a JSON object from the FB server
local response = event.response
native.showAlert( “FB DBUG”, response, {“OK”} )
end
end
function fbButtonTapped()
– FacebookController:instance():showStatus(self)
– first argument is the app id that you get from Facebook
facebook.login( “1234567890”, listener, {“publish_stream”} )[/lua]
Without the facebook app installed I get the login success alert and the json for the friends list alert.
With the facebook app installed I get the login failed alert with nothing in the event response.
Can any one please provide any suggestions as I am at a total loss… [import]uid: 60648 topic_id: 28437 reply_id: 328437[/import]


