Not connected GPGS v2

Hi Rob and thank you again for your help.

I didn’t express it correctly.

I was talking about the little popup with the nick name.

With gpgs v.1 it appeared almost every time I was opening an app. 

@Aarbron 

Thank you for showing this: 

local data = gpgs.snapshots.getSnapshot (event.snapshotId)

For the login part, did you try logging out and then completely closing the app from background in the logged out state. And then relaunching the app to login again. Did you get any errors or the login functionality still works for you? 

I am using isAuthenticated() to check but I get runtime error if i follow the above steps. 

@mysticeti

Didn’t try that.

I use gpgs only for snapshots. 

@aarbron

I understand that but what I am trying to say is that when you implement login button for user to login to use snapshots do you use isAuthenticated() to check whether user is already logged in to show that the user is logged in already? I am using the using the following code to implement the login button for gpgs. I always get runtime error if the user is in logged out state and trying to log back in. This error doesn’t happen at the very first run of the game, everything from login, snapshots and other functionality seems to work fine. This happens only when a user might log out from gpgs and closes the app from the background and tries to log back in later.  

local function googVerify () if ( composer.getSceneName( "current" ) == "scoreboardScreen" and (globalData.gpgs) ) thengpgsButtonDisplayObjects.gpgsLoggedInButton = display.newImageRect(analyticsImageSheet, 10, analyticsSheetInfo.sheet.frames[10].width, analyticsSheetInfo.sheet.frames[10].height)         gpgsButtonDisplayObjects.gpgsLoggedInButton.isVisible = false         gpgsButtonDisplayObjects.gpgsLoggedInButton.x = display.contentWidth \* 0.50         gpgsButtonDisplayObjects.gpgsLoggedInButton.y = display.contentHeight \* 0.29         sceneGroup:insert( gpgsButtonDisplayObjects.gpgsLoggedInButton )         scrollView:insert( gpgsButtonDisplayObjects.gpgsLoggedInButton )         gpgsButtonDisplayObjects.gpgsLoggedInButton:scale(display.contentWidth \* 0.0015, display.contentWidth \* 0.0015)         gpgsButtonDisplayObjects.gpgsLoggedOutButton = display.newImageRect(analyticsImageSheet, 11, analyticsSheetInfo.sheet.frames[11].width, analyticsSheetInfo.sheet.frames[11].height)         gpgsButtonDisplayObjects.gpgsLoggedOutButton.isVisible = false         gpgsButtonDisplayObjects.gpgsLoggedOutButton.x = display.contentWidth \* 0.50         gpgsButtonDisplayObjects.gpgsLoggedOutButton.y = display.contentHeight \* 0.29         sceneGroup:insert( gpgsButtonDisplayObjects.gpgsLoggedOutButton )         scrollView:insert( gpgsButtonDisplayObjects.gpgsLoggedOutButton )         gpgsButtonDisplayObjects.gpgsLoggedOutButton:scale(display.contentWidth \* 0.0014, display.contentWidth \* 0.0014)          if ( gameData.gpgsDataFirstCheck == false ) then           if ( (globalData.gpgs) and (globalData.gpgs.isAuthenticated()) ) then              gpgsButtonDisplayObjects.gpgsLoggedInButton.isVisible = true             gpgsDownloadData()           else              gpgsButtonDisplayObjects.gpgsLoggedOutButton.isVisible = true           end          else           gpgsDownloadData()           gameData.gpgsDataFirstCheck = false           globalData.loadsave.saveTable( gameData, "gameData.json" )         end -- first time game opening check to prevent gpgs button overlap         scoreboardFunctions.onGpgsLoginButtonTap = function( self, event )           if ( (globalData.gpgs) and (globalData.gpgs.isAuthenticated()) ) then             --logout             globalData.gpgs.logout()             gameData.gpgsDataUserPref = "logged out"             globalData.loadsave.saveTable( gameData, "gameData.json" )             gpgsButtonDisplayObjects.gpgsLoggedOutButton.isVisible = true             gpgsButtonDisplayObjects.gpgsLoggedInButton.isVisible = false           elseif (globalData.gpgs) then             --login             globalData.gpgs.login( { userInitiated = true, listener = gpgsLoginListener } )             local function toggleGPGSToLogin ()               if ((globalData.gpgs) and (globalData.gpgs.isAuthenticated()) ) then                 gpgsButtonDisplayObjects.gpgsLoggedOutButton.isVisible = false                 gpgsButtonDisplayObjects.gpgsLoggedInButton.isVisible = true               end             end             timerToggleGPGSCheck = timer.performWithDelay(500, toggleGPGSToLogin, 3)           end -- login or logout conditional END           return true         end -- onGpgsLoginButtonTap func END         gpgsButtonDisplayObjects.gpgsLoggedInButton:addEventListener( "tap", scoreboardFunctions.onGpgsLoginButtonTap )         gpgsButtonDisplayObjects.gpgsLoggedOutButton:addEventListener( "tap", scoreboardFunctions.onGpgsLoginButtonTap )       end -- googLicensed END     end -- googVerify func END

Would appreciate the help very much. 

@mysticeti

Sorry I don’t use isAuthenticated()!!

gpgs v2 is beta, I guess Corona will improve it.