I am trying to let user to login my app using their facebook account. I am able to see the app authorization screen and I am able to get the login token in the login response. But I am not able to get user profile. I need the email and user facebook id after login.
local function fbLoginProcess(event) local facebook = require("plugin.facebook.v4") local json = require( "json" ) local function fbUser() local profile = facebook.request( "me" ) alert('Profile Response: '..tostring(profile)) end local function fbResponse(event) if event.type == 'session' then -- login local status = event.phase -- login, loginFailed, loginCancelled, logout alert('Status: '..status..', Token: '..event.token) fbUser() else alert('Other: '..json.decode(event.response)) end end facebook.login( fbResponse, {"public\_profile", "email"}) end btnFbLogin:addEventListener('tap', fbLoginProcess)
I get nil response in the facebook.request( “me” ) call.
I am using corona SDK Version 2016.2900 (2016.6.14) and was testing on Android device.