I followed the Facebook Manual basic integration but without the platform added. I’m only testing it with the DMENGINE but I don’t get the pprint(response) in my Console.
When I test the app the Facebook login pops up and as soon as I press continue nothing happens.
Something like this is supposed to show in my Console when I test it:
I think you need to bundle using the bundle menu and install that version for it to work. Once you have it installed you’ll be able to target it (if it’s a debug version) from the editor as well.
You mean that you haven’t added Android in the settings for you app on Facebook? You need to do that. And make sure the package name matches what you have in game.project.
Must the app be available on Google Play for this to work because I haven’t yet created an app for this on Google Play.
So I’ve added the Android platform with the Google Play Package name and it matches the one from my game.project and I received this:
There was a problem verifying package name: com.player.swiper on Google Play. Please check the package name and try again.
If your app isn’t listed publicly on Google Play yet you can ignore this message.
local function get_me_callback(self, id, response)
-- The response table includes all the response data
pprint(response)
end
local function fb_login(self, data)
if data.status == facebook.STATE_OPEN then
-- Logged in ok. Let's try reading some "me" data through the
-- HTTP graph API.
local token = facebook.access_token()
local url = "https://graph.facebook.com/me/?access_token=" .. token
http.request(url, "GET", get_me_callback)
elseif data.status == facebook.STATE_CLOSED_LOGIN_FAILED then
print("Login Failed")
end
if data.error then
print("Error")
else
print("No Error")
end
end
function init(self)
-- Log in with read permissions.
local permissions = { "public_profile", "email" }
facebook.login_with_read_permissions(permissions, fb_login)
end