openforge / capacitor-game-connect

A capacitor plugin to connect to both Apple Game Center and Google Play Game Services libraries.
21 stars 8 forks source link

Error 4 when clicking signIn #22

Open mledwards opened 10 months ago

mledwards commented 10 months ago

When running the signIn function, I'm getting this back when testing on my real android device

{"save":false,"callbackId":"62724367","pluginId":"CapacitorGameConnect","methodName":"signIn","success":false,"error":{"message":"4: "}}

Any ideas why?

mledwards commented 10 months ago

Ah, I hadn't gone through the full OAuth consent screen process to send for verification. Will check back once that's verified.

Ricardo385 commented 10 months ago

Hey @mledwards thanks for using the plugin! And yeah, this is a common error by Google Play Services for the Fingerprint Certificate. Also, when you have finished setting up all in Google Play Console don't forget to sign your APK and then install it in your phone. If you need help, don't hesitate to ping us!

mledwards commented 10 months ago

Thanks, will do! I haven't made the fingerprint certificate yet, can I do that once I'm verified?

mledwards commented 10 months ago

Or am I able to continue testing the Google Play services during verification if I sort the fingerprint certificate out? They said verification may take 3-5 weeks 😭

Ricardo385 commented 10 months ago

@mledwards Hmm, you don't need to wait for any verification to create a fingerprint certificate. Follow the bullet 6 from the README for the Android setup https://github.com/openforge/capacitor-game-connect#setup-for-android

Ricardo385 commented 10 months ago

Hey @mledwards I want to follow up on this, were you able to get the plugin work after get the certificate fingerprint and sign your APK?

mledwards commented 10 months ago

Hi @Ricardo385 , still not having any luck.

I created OAuth credential in Google Console, run the keytool with my keystore, copied my SHA1 into the required field, saved.

Then I went back to Google Play, chose the credentials from the dropdown, clicked publish, waited for that to change from draft to published.

Then I went back to my code, added a test signIn button (see below). Loaded this up in my physical device. But it still comes back with Sending plugin error: {"save":false,"callbackId":"773919","pluginId":"CapacitorGameConnect","methodName":"signIn","success":false,"error":{"message":"4: "}}

This is the code I was running.

const signIn = async () => {
    try {
      const user = await CapacitorGameConnect.signIn();
      console.log("user", user);
    } catch (error) {
      console.log("error", error);
      console.log("error.message", error.message);
    }
  };

Any ideas?

mledwards commented 10 months ago

@Ricardo385 Oh I just read your last message, will I only be able to test my play center functionality on the APK, not through android studio using the physical device option?

Ricardo385 commented 10 months ago

Hey @mledwards sorry for the late response! Yes, that's correct. Unfortunately, Android will only allow you to test the Play Games functionality on a real device. See our docs in Testing Limitations where we explain this https://github.com/openforge/capacitor-game-connect#testing-limitations

But, is not a big deal to have your APK signed. Just build your APK as signed in Android Studio and that would be all.

Regards,

mledwards commented 9 months ago

Ah ok. I read the testing limitations as if I can use the "physical device" option through android stydui. Not building the APK, and then installing it on my physical device.

LDmitrii commented 9 months ago

Hi, have same issue, @mledwards if you fix it, can you help me?

mledwards commented 7 months ago

I've not managed to test this yet, been caught up on other projects. But it's definitely on my radar to test the sign in / leaderboard on my phone using an APK.