Hi guys, we have been pondering this problem for the past 2 days and thought I’d give some feedback. The tests have been made on 2 different Android devices (3.1 and 4.0). This is our experience so far…
Corona build 1168:
With Facebook App installed (v3.4)
- Invoking facebook.login suspends the Corona app
- Native Android alert saying “Facebook - xxxxx would like to access your public profile and friends list. OK | CANCEL”
- Clicking OK resumes the Corona app
- An empty “session” event is received by the facebook listener (no event.phase or token), i.e. the login FAILS
Without Facebook App installed
- Invoking facebook.login suspends the Corona app
- A browser based Facebook dialog appear, requesting user to login and granting permissions
- After completing the dialogs, the Corona app resumes and crashes (“The application xxxxx has stopped unexpectedly. Please try again”)
Corona build 1131:
With Facebook App installed (v3.4)
- invoking facebook.login suspends the Corona app
- Facebook App asking for permission to access profile and friends list
- After accepting permissions the Corona app resumes
- A “session” event with event.phase and event.token is received by the facebook listener
- Invoking facebook.showDialog(“apprequests”) summons the request dialog
- Upon completing (or canceling) the dialog, the app continues normally, but:
- An empty “dialog” event is received by the facebook listener. I.e. it’s not possible to verify the requests (as with IOS).
- Edit: Cancelling the dialog fires an isError event with event.response set to"Dialog cancelled". This seems to be the only dialog event that actually generates a response.
Without Facebook App installed
- The process is identical to the above except the login- and permission dialogs are browser based.
Example code:
local function fbListener( event ) if event.isError then -- handle error else if (event.type == "session") then if (event.phase == "login") then facebook.showDialog("apprequests"); end; elseif (event.type == "dialog") then -- handle dialog results end; end; end; facebook.login( FB\_APP\_ID, fbListener, {} ); -- no extended permissions needed