Skip to content

Commit 68e93c9

Browse files
[google_sign_in] Redesign API for current identity SDKs - Platform Implementations (#9479)
This is the platform implementation portion of #9267 Part of flutter/flutter#119300 ## Pre-Review Checklist [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
1 parent bf830ba commit 68e93c9

File tree

56 files changed

+6954
-5093
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+6954
-5093
lines changed

packages/google_sign_in/google_sign_in_android/CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
## NEXT
1+
## 7.0.0
22

3+
* **BREAKING CHANGE**: Switches to implementing version 3.0 of the platform
4+
interface package, rather than 2.x, significantly changing the API surface.
5+
* Switches to Sign in with Google (`CredentialManager`) as the underlying
6+
SDK, removing usage of the deprecated Google Sign In for Android SDK.
37
* Updates minimum supported SDK version to Flutter 3.27/Dart 3.6.
48

59
## 6.2.1

packages/google_sign_in/google_sign_in_android/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,25 @@ should add it to your `pubspec.yaml` as usual.
1313

1414
[1]: https://pub.dev/packages/google_sign_in
1515
[2]: https://flutter.dev/to/endorsed-federated-plugin
16+
17+
## Integration
18+
19+
To use Google Sign-In, you'll need to register your application, either
20+
[using Firebase](https://firebase.google.com/docs/android/setup), or
21+
[directly with Google Cloud Platform](https://developer.android.com/identity/sign-in/credential-manager-siwg#set-google).
22+
23+
* If you are use the `google-services.json` file and Gradle-based registration
24+
system, no identifiers need to be provided in Dart when initializing the
25+
`GoogleSignIn` instance when running on Android.
26+
* If you are not using `google-services.json`, you need to pass the client
27+
ID of the *web* application you registered as the `serverClientId` when
28+
initializing the `GoogleSignIn` instance.
29+
30+
If you encounter `APIException` errors, double-check that you have followed all
31+
of the registration steps in the instructions above.
32+
33+
You will also need to enable any OAuth APIs that you want, using the
34+
[Google Cloud Platform API manager](https://console.developers.google.com/). For
35+
example, if you want to mimic the behavior of the Google Sign-In example app,
36+
you'll need to enable the
37+
[Google People API](https://developers.google.com/people/).

packages/google_sign_in/google_sign_in_android/android/build.gradle

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@ group 'io.flutter.plugins.googlesignin'
22
version '1.0-SNAPSHOT'
33

44
buildscript {
5+
ext.kotlin_version = '2.1.10'
56
repositories {
67
google()
78
mavenCentral()
89
}
910

1011
dependencies {
1112
classpath 'com.android.tools.build:gradle:8.5.0'
13+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1214
}
1315
}
1416

@@ -20,6 +22,7 @@ rootProject.allprojects {
2022
}
2123

2224
apply plugin: 'com.android.library'
25+
apply plugin: 'kotlin-android'
2326

2427
android {
2528
namespace 'io.flutter.plugins.googlesignin'
@@ -35,6 +38,14 @@ android {
3538
targetCompatibility JavaVersion.VERSION_11
3639
}
3740

41+
kotlinOptions {
42+
jvmTarget = '11'
43+
}
44+
45+
sourceSets {
46+
main.java.srcDirs += 'src/main/kotlin'
47+
}
48+
3849
lintOptions {
3950
checkAllWarnings true
4051
warningsAsErrors true
@@ -56,7 +67,10 @@ android {
5667
}
5768

5869
dependencies {
59-
implementation 'com.google.android.gms:play-services-auth:21.0.0'
70+
implementation 'androidx.credentials:credentials:1.5.0'
71+
implementation 'androidx.credentials:credentials-play-services-auth:1.5.0'
72+
implementation 'com.google.android.libraries.identity.googleid:googleid:1.1.1'
73+
implementation 'com.google.android.gms:play-services-auth:21.3.0'
6074
testImplementation 'junit:junit:4.13.2'
6175
testImplementation 'org.mockito:mockito-inline:5.2.0'
6276
}

0 commit comments

Comments
 (0)