Blank screen after successful Facebook post.

I have a feeling I am doing something very stupid. My setup is as follows:

main.lua contains the facebook listener which is designed to post an image saved from a displaygroup (User asking for help on Facebook) which is very minimal and looks as follows:

function listener( event )   print ("Facebook Listener Activated...")   if ( "session" == event.type ) then     if ( "login" ~= event.phase ) then       showPopup("Logging into Facebook failed", "Please check your Internet connection.")       return     end     access\_token = event.token     if fbCommand == POST\_PHOTO then       local attachment = {         message = "Stuck on level ".. playlevel .. " of Game.",         source = { baseDir=system.DocumentsDirectory, filename="quiz.jpg", type="image" }         }             facebook.request( "me/photos", "POST", attachment )          fblastaction = "processing"     end   elseif ( "request" == event.type ) then     local response = event.response     if ( not event.isError ) then       if fbCommand == GET\_USER\_INFO then         response = json.decode( event.response )       elseif (fbCommand == POST\_MSG) or (fbCommand == POST\_PHOTO) then         showPopup("Game Name", "Thank you for posting to Facebook.")         savegame()         fblastaction = "posted"       end     else       if appfb == 0 then         showPopup("Facebook post failed", "Please check your Internet connection and try again.")       end       fblastaction = "error"     end   end end function postPhotoToWall(msg)   print("Posting Photo to wall " .. appId)   fbmessage = msg   fbCommand = POST\_PHOTO   facebook.login( appId, listener, {"publish\_actions", "email"} ) end

game-scene has all graphics in display groups which are generated during the scene:createScene event plus Admob ads showing. This then calls the Facebook post command with:

display.save( quizlayer, "quiz.jpg" ) postPhotoToWall("Playing Game")

The good news is that the routine works - it saves the file to the user directory and successfully makes the post to Facebook which can be seen in the timeline.

However, the screen goes blank as normal during the Facebook post. Once control is returned, I am left with a blank screen and only the Admob banner showing. It looks as if all my display groups have been lost.

I have nothing in the game-scene listeners to purge or remove the scene and am at a loss as to what the cause is.

Has anyone seen this behaviour before?

It appears that the issue is not with the Facebook plugin but with moving between scenes (currently using storyboard). For example, I have created a dummy scene that only returns back to the game-scene in it’s createScene handler:

game-scene -> dummy-scene -> game-scene

When I return to the game-scene, the screen is blank. Not sure what is causing this as I am not destroying the game-scene view at any point. All graphics assets in the game-scene are inserted into display groups that are themselves inserted into the main scene view:

-- In createScene handler: local sceneGroup = self.view gamelayer = display.newGroup() -- gamelayer defined as local variable in game-scene.lua sceneGroup:insert(gamelayer) -- leveltext defined as a scene scope local variable leveltext = display.newText( "1" , \_W-121, 26, "arial", 8 ) leveltext:setFillColor(0,0,0) leveltext.anchorx=0.5 leveltext.anchory=0.5 gamelayer:insert ( leveltext )

If I move to a different scene and back again, the leveltext object is no longer displayed.

Will try moving the project over to composer to see if this helps at all.

Converted from storyboard to composer and all now working.

It appears that the issue is not with the Facebook plugin but with moving between scenes (currently using storyboard). For example, I have created a dummy scene that only returns back to the game-scene in it’s createScene handler:

game-scene -> dummy-scene -> game-scene

When I return to the game-scene, the screen is blank. Not sure what is causing this as I am not destroying the game-scene view at any point. All graphics assets in the game-scene are inserted into display groups that are themselves inserted into the main scene view:

-- In createScene handler: local sceneGroup = self.view gamelayer = display.newGroup() -- gamelayer defined as local variable in game-scene.lua sceneGroup:insert(gamelayer) -- leveltext defined as a scene scope local variable leveltext = display.newText( "1" , \_W-121, 26, "arial", 8 ) leveltext:setFillColor(0,0,0) leveltext.anchorx=0.5 leveltext.anchory=0.5 gamelayer:insert ( leveltext )

If I move to a different scene and back again, the leveltext object is no longer displayed.

Will try moving the project over to composer to see if this helps at all.

Converted from storyboard to composer and all now working.