Hi there 
It’s my first time trying to use facebook and corona together, and I’m having a simple “problem” (it’s not a logical or code problem, its more visual). When my app tries to login facebook a black screen opens twice with a spinning circle (on android). I want to trade this for one of my loadings, I tried to do something like this to solve the problem:
local function onSystemEvent ( event ) if event.type == "applicationSuspend" then --its logging on facebook bigLogo = display.newImage("bigLogoLetsParty.png", systemDocumentsDirectory) bigLogo.x = display.contentCenterX bigLogo.y = display.contentCenterY end if event.type == "applicationResume" then bigLogo:removeSelf() bigLogo = nil end end
But it just failed.
Here’s the another part of the code:
local composer = require "composer" local json = require( "json" ) local fieldRequested = "me/events/created" display.setDefault("background", 255, 255, 255, 1) local function facebookListener( event ) print( "event.name", event.name ) --"fbconnect" print( "event.type:", event.type ) --type is either "session", "request", or "dialog" print( "isError: " .. tostring( event.isError ) ) print( "didComplete: " .. tostring( event.didComplete ) ) --"session" events cover various login/logout events --"request" events handle calls to various Graph API calls --"dialog" events are standard popup boxes that can be displayed if ( "session" == event.type ) then --options are: "login", "loginFailed", "loginCancelled", or "logout" if ( "login" == event.phase ) then local access\_token = event.token --code for tasks following a successful login end elseif ( "request" == event.type ) then --print("facebook request") if ( not event.isError ) then --process response data here if(event.response == nil) then print("response nil") else print("fieldRequested: ") print(fieldRequested) local response = json.decode( event.response ) print("response decoded = ") if (fieldRequested == "me/events/created") then for i,v in ipairs(response.data) do --print(response.data[n].name) print(v.name) end end end end elseif ( "dialog" == event.type ) then print( "dialog", event.response ) --handle dialog results here end end local fbAppID = "XXXXXXXXXXXXXXXX"; -- id do aplicativo / appID facebook.login(fbAppID, facebookListener, {"user\_friends","user\_events","publish\_actions"} ) --Id, listener e permissoes / Id, listener and permissions