Skip to content
This repository was archived by the owner on Apr 19, 2026. It is now read-only.

Recent migration attempt#256

Open
Thaina wants to merge 38 commits into
googlesamples:masterfrom
Thaina:newmigration
Open

Recent migration attempt#256
Thaina wants to merge 38 commits into
googlesamples:masterfrom
Thaina:newmigration

Conversation

@Thaina

@Thaina Thaina commented Jun 10, 2024

Copy link
Copy Markdown

Since there is deprecation and migration recommendation from signin system

: copied from readme >

https://developer.android.com/identity/sign-in/legacy-gsi-migration
https://developers.google.com/identity/sign-in/ios/quick-migration-guide

Thank for ios fix which was cherrypicked from this fork : https://github.com/pillsgood/google-signin-unity

Android was migrated to use CredentialManager and AuthorizationClient since GoogleSignInAccount was deprecated

However, GoogleIdTokenCredential actually not provide numeric unique ID anymore and set email as userId instead, so I have to extract jwt sub value from idToken (which seem like the same id as userId from GoogleSignIn of other platform)

Tested in unity 2021.3.21 and unity 6000.0.4

Add UPM dependency with branch tag https://github.com/Thaina/google-signin-unity.git#newmigration

{
  "dependencies": {
    "com.google.external-dependency-manager": "https://github.com/googlesamples/unity-jar-resolver.git?path=upm",
    "com.google.signin": "https://github.com/Thaina/google-signin-unity.git#newmigration",
}

@google-cla

google-cla Bot commented Jun 10, 2024

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@Thaina

Thaina commented Jun 10, 2024

Copy link
Copy Markdown
Author

@calumma-robert Do you interest in signing google CLA agreement?

@calumma-robert

Copy link
Copy Markdown

@Thaina done!

@Thaina

Thaina commented Jun 10, 2024

Copy link
Copy Markdown
Author

Thank you very much

update readme
@Thaina Thaina force-pushed the newmigration branch 2 times, most recently from 3da1816 to 6c3c741 Compare June 13, 2024 12:45
@Thaina

Thaina commented Feb 14, 2025

Copy link
Copy Markdown
Author

@shiva30122 Please investigate the criteria mention in this link to determine if your device's setting are not met any of it

https://developer.android.com/identity/sign-in/credential-manager-siwg#enable-sign-in

@rysenko

rysenko commented Jun 25, 2025

Copy link
Copy Markdown

@Thaina I'm testing your branch in my app. And I'm facing issue with discrepancies in GoogleSignInStatusCode between platforms. When I open Google Sign-In dialog in the iOS app and instead of continuing the sign-in process I press "Cancel" on account selection popup, I get GoogleSignInStatusCode with value 2 that is treated as SERVICE_VERSION_UPDATE_REQUIRED status by plugin. Seems like status codes are just different now between iOS and Android. iOS still preserves older status code with status code 2 being GoogleSignInStatusCode.Cancel. Is that something you know about and willing to fix in the branch?

@Thaina

Thaina commented Jun 25, 2025

Copy link
Copy Markdown
Author

I would take a look and try to update the package in near future. There is many things I would like to update too. But currently now very busy though, pardon me that it may not be so soon

Thaina and others added 2 commits July 19, 2025 20:40
#28)

* Adjust runtime configuration for webClientId in GoogleSignIn_Configure

* Fix typo of GIDConfiguration's property
@Milan1660

Copy link
Copy Markdown

Hello,

I'm currently integrating Google Sign-In in my Unity Android project. While checking library alignment for 16 KB page size using the recommended tooling, I found that the native-googlesignin.so file is not aligned to 16 KB, unlike the other .so libraries in the project.

Alignment Check Result:

Image

Because of this misalignment, I am getting below warning on Google Play Console.

Image

Environment details:

Unity Version: 6000.0.58f2
Google Sign-In Version: 1.0.4
Platform: Android

@Thaina

Thaina commented Oct 14, 2025

Copy link
Copy Markdown
Author

Are you really using my branch with upm?

@Milan1660

Copy link
Copy Markdown

Are you really using my branch with upm?

Yes, I am using your branch with UPM

@Thaina

Thaina commented Oct 14, 2025

Copy link
Copy Markdown
Author

@Milan1660 Have you test by creating clean fresh project and only install EDM4U and google signin?

@Milan1660

Copy link
Copy Markdown

@Milan1660 Have you test by creating clean fresh project and only install EDM4U and google signin?

Yes, I tried with new project and I am getting alignment issue in this new project.
Have you checked native-googlesignin.so is aligned to 16 KB after build?

@Thaina

Thaina commented Oct 14, 2025

Copy link
Copy Markdown
Author

I have ask you are you using my branch because I don't think my branch using native-googlesignin.so anymore. It should not even build native-googlesignin.so out of the repo

Maybe native-googlesignin.so is in the library folder?

image

@Thaina

Thaina commented Oct 14, 2025

Copy link
Copy Markdown
Author

I have test build aab and upload to google play internal track with 6.0.59f2 and there was no error or warning about 16 kb page size at all

@Milan1660

Milan1660 commented Oct 15, 2025

Copy link
Copy Markdown

native-googlesignin.so is generated build time and added to build. But it generated when I use below configuration code.

GoogleSignIn.Configuration = new GoogleSignInConfiguration() {
            RequestEmail = true,
            RequestProfile = true,
            RequestIdToken = true,
            RequestAuthCode = true,
            // must be web client ID, not android client ID
            WebClientId = "XXXXXXXXX-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com",
#if UNITY_EDITOR || UNITY_STANDALONE
            ClientSecret = "XXXXXX-xxxXXXxxxXXXxxx-xxxxXXXXX" // optional for windows/macos and test in editor
#endif
        };

Now, I am using your same code and scene in new project. With your code native-googlesignin.so is not generated in the build so that's not issue now but I am getting this below error on signin in Android and I am not cancelling or doing anything, when I select account to signin I am just getting this error.

Error - onFailure class androidx.credentials.exceptions.GetCredentialCancellationException : activity is cancelled by the user.

Can you help me with this?

@Thaina

Thaina commented Oct 15, 2025

Copy link
Copy Markdown
Author

That kind of error seem like a wrong setting in webclientID or fingerprint and keystore file

@Milan1660

Copy link
Copy Markdown

Now working fine in Android & iOS.

Thank you @Thaina.

Refactor GoogleSignInImplEditor for silentsignin support with cache
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.