Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
324 views
in Technique[技术] by (71.8m points)

android - Testing Games Services using upload key instead of Google Play App signing key

I currently have GPGS set up and working for my app. I'm having problems with some features while debugging my app using my upload key. I followed the steps here: https://stackoverflow.com/a/45270329/5434860 and am able to sign into Google while using the app signed with the secure "app signing key" that Google keeps on a secure server and am able to sign in using the app signed with my "upload key". (I have two OAuth 2.0 client IDs in there. One for production and one for debugging)

My problem is similar to Test Google Play Games on app signed with upload key and Android RealTimeMultiplayer onRoomCreated getting status 2 : STATUS_CLIENT_RECONNECT_REQUIRED. While I can sign in using the app signed with my upload key, I cannot actually fully test the different games services I use. Nether of those two questions has been solved.

For instance, while trying to test Real Time Multiplayer, I'll get a statusCode of 2 (CLIENT_RECONNECT_REQUIRED) in onRoomCreated. This only happens when I'm using the app signed with my upload key. To fully test this I have to create an internal release on my Google Play Console. When I did that, multiplayer, achievements, and leaderboards were fully functional and I was able to test them.

I also have anti-piracy off, so that isn't the problem. If I remove the OAuth crediential from console.developers.google.com it stops being able to sign in, but when I add it back it still isn't fully functional as the only thing I can do is sign in.

Currently, my Game Service project is published and I am trying to allow two SHA1 keys to be able to access it. While I am able to login using the upload key, I would like to be able to fully test my app without having to create a new internal release each time so it's signed with the correct key.

I would really like to be able to test Games Services without uploading it to Google Play Console every time.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

A month ago I contacted google about this problem and although it took awhile for them to get back to me, I finally have a solution.

My problem was that I manually created the OAuth 2.0 Client ID at console.developers.google.com. What you are actually supposed to do is go to your Game Service, go to Linked Apps and add another linked app. You will choose the same app as you did for your other Linked App, but for the SHA1 key, you will put whatever key you want to do.

So when you want to add another SHA1 key that you are able to test with, DO NOT manually create the OAuth 2.0 Client ID. Go to linked apps in your game service and link the app!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...