Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Not connected GPGS v2
Started by oliver.kjellen Feb 23 2019 12:53 PM

32 replies to this topic
[TOPIC CONTROLS]
Page 2 of 2 1 2
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#26

Aarbron

[GLOBAL: userInfoPane.html]
Aarbron
  • Contributor

  • 221 posts
  • Corona SDK

On March 7 gpgs version 1 will stop working because of Google+ APIs shutting down.

 

There is an issue with gpgs version 2 reported months ago from many developers (myself included).

No popup login and snapshots for saving / loading not working.

 

You are going to leave us without key features in our existing apps.

 

It was reported that Unity and Android Studio apps has no problem with this change.

It is just Corona.

 

Rob is alone here. Shouldn't more Corona stuff post something and try to help us?

 

Edit:

I'm not using App Signing from Google Play.

 

What kind of updates should be done (for apps already live in store long ago) in:

play.google.com/apps/publish

and

console.developers.google.com/

??


Edited by Aarbron, 06 March 2019 - 06:18 AM.


[TOPIC: post.html]
#27

Aarbron

[GLOBAL: userInfoPane.html]
Aarbron
  • Contributor

  • 221 posts
  • Corona SDK

I have working login and snapshots although login popup doesn't appear.

Maybe that's the way it works now for already installed apps?

 

Posts about APIs and Rob's code were very helpful and the final touch for me was this:

local data = gpgs.snapshots.getSnapshot (event.snapshotId)
-- instead of
-- local data = event.snapshot.contents.read()

Thank you :)



[TOPIC: post.html]
#28

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,680 posts
  • Enterprise

I don't believe you will get a login prompt once you have successfully logged in.

 

Rob



[TOPIC: post.html]
#29

Aarbron

[GLOBAL: userInfoPane.html]
Aarbron
  • Contributor

  • 221 posts
  • Corona SDK

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. 



[TOPIC: post.html]
#30

mysticeti

[GLOBAL: userInfoPane.html]
mysticeti
  • Contributor

  • 143 posts
  • Corona SDK

@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. 



[TOPIC: post.html]
#31

Aarbron

[GLOBAL: userInfoPane.html]
Aarbron
  • Contributor

  • 221 posts
  • Corona SDK

@mysticeti

 

Didn't try that.

I use gpgs only for snapshots. 



[TOPIC: post.html]
#32

mysticeti

[GLOBAL: userInfoPane.html]
mysticeti
  • Contributor

  • 143 posts
  • Corona SDK

@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. 



[TOPIC: post.html]
#33

Aarbron

[GLOBAL: userInfoPane.html]
Aarbron
  • Contributor

  • 221 posts
  • Corona SDK

@mysticeti

 

Sorry I don't use isAuthenticated()!!

 

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




[topic_controls]
Page 2 of 2 1 2
 
[/topic_controls]