How can I detect if the user has already logged in with Facebook or not?

I want to integrate an invitation function which first ask users to sign in their Facebook account and if they’ve already logged in, it will show the friends list but I don’t know how to check if the user signing in or not and still don’t know how to check the permission that the user has already allowed. I mean that do the Corona SDK have the function to handle all of these?

Another question is that after I do this code …

local function listener( event ) if "session" == event.type then if "login" == event.phase then facebook.request("me/feed","POST",{message="Test Message",link="https://github.com"}) end end end facebook.login(appId,listener,{"publish\_actions"})

It showed me the message “You’ve already authorised this app” and after clicking ok, it just returned an empty table. Then I click “done” to make the table vanish and it returned an empty white background and post nothing to my feed. Could someone help correcting my code?

Hi ??

Hi ??