Skip to content

Commit 64f17b3

Browse files
committed
Migrate android to CredentialManager
Migrate ios to 7.1.0
1 parent 1c4a52e commit 64f17b3

19 files changed

+628
-1552
lines changed

GoogleSignIn/Editor/GoogleSignInDependencies.xml

+5-7
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,14 @@
33
<!-- See https://github.com/googlesamples/unity-jar-resolver#usage for
44
how to configure dependencies -->
55
<androidPackages>
6-
<androidPackage spec="com.google.android.gms:play-services-auth:20+">
7-
<androidSdkPackageIds>
8-
<androidSdkPackageId>extra-google-m2repository</androidSdkPackageId>
9-
</androidSdkPackageIds>
10-
</androidPackage>
6+
<androidPackage spec="androidx.credentials:credentials:1.2.2" />
7+
<androidPackage spec="androidx.credentials:credentials-play-services-auth:1.2.2" />
8+
<androidPackage spec="com.google.android.libraries.identity.googleid:googleid:1.1.0" />
9+
<androidPackage spec="com.google.android.gms:play-services-auth:21.2.0" />
1110
</androidPackages>
1211

1312
<!-- iOS Cocoapod dependencies can be specified by each iosPod element. -->
1413
<iosPods>
15-
<iosPod name="GoogleSignIn" version="~> 6.2.4" bitcodeEnabled="false" minTargetSdk="6.0">
16-
</iosPod>
14+
<iosPod name="GoogleSignIn" version="~> 7.1.0" bitcodeEnabled="false" />
1715
</iosPods>
1816
</dependencies>

GoogleSignIn/GoogleSignIn.cs

+6-10
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,7 @@ public static GoogleSignInConfiguration Configuration {
6969
if (theInstance == null || theConfiguration == value || theConfiguration == null) {
7070
theConfiguration = value;
7171
} else {
72-
throw new SignInException(GoogleSignInStatusCode.DEVELOPER_ERROR,
73-
"DefaultInstance already created. " +
74-
" Cannot change configuration after creation.");
72+
throw new SignInException(GoogleSignInStatusCode.DEVELOPER_ERROR,"DefaultInstance already created. Cannot change configuration after creation.");
7573
}
7674
}
7775

@@ -105,7 +103,7 @@ internal GoogleSignIn(ISignInImpl impl) {
105103
}
106104

107105
public void EnableDebugLogging(bool flag) {
108-
impl.EnableDebugLogging(flag);
106+
impl.EnableDebugLogging(flag);
109107
}
110108

111109
/// <summary>Starts the authentication process.</summary>
@@ -116,14 +114,13 @@ public void EnableDebugLogging(bool flag) {
116114
/// </remarks>
117115
public Task<GoogleSignInUser> SignIn() {
118116
var tcs = new TaskCompletionSource<GoogleSignInUser>();
119-
SignInHelperObject.Instance.StartCoroutine(
120-
impl.SignIn().WaitForResult(tcs));
117+
SignInHelperObject.Instance.StartCoroutine(impl.SignIn().WaitForResult(tcs));
121118
return tcs.Task;
122119
}
123120

124121
public Task<GoogleSignInUser> SignInAsync() {
125122
var tcs = new TaskCompletionSource<GoogleSignInUser>();
126-
impl.SignIn().WaitForResultAsync(tcs);
123+
impl.SignIn().WaitForResultAsync(tcs).ContinueWith((task) => {});
127124
return tcs.Task;
128125
}
129126

@@ -137,14 +134,13 @@ public Task<GoogleSignInUser> SignInAsync() {
137134
/// </remarks>
138135
public Task<GoogleSignInUser> SignInSilently() {
139136
var tcs = new TaskCompletionSource<GoogleSignInUser>();
140-
SignInHelperObject.Instance.StartCoroutine(
141-
impl.SignInSilently().WaitForResult(tcs));
137+
SignInHelperObject.Instance.StartCoroutine(impl.SignInSilently().WaitForResult(tcs));
142138
return tcs.Task;
143139
}
144140

145141
public Task<GoogleSignInUser> SignInSilentlyAsync() {
146142
var tcs = new TaskCompletionSource<GoogleSignInUser>();
147-
impl.SignInSilently().WaitForResultAsync(tcs);
143+
impl.SignIn().WaitForResultAsync(tcs).ContinueWith((task) => {});
148144
return tcs.Task;
149145
}
150146

GoogleSignIn/Impl/BaseObject.cs

+3-6
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ public BaseObject(IntPtr intPtr) {
3535

3636
protected HandleRef SelfPtr() {
3737
if (selfHandleRef.Equals(nullSelf)) {
38-
throw new InvalidOperationException(
39-
"Attempted to use object after it was cleaned up");
38+
throw new InvalidOperationException("Attempted to use object after it was cleaned up");
4039
}
4140
return selfHandleRef;
4241
}
@@ -45,8 +44,7 @@ public virtual void Dispose() {
4544
selfHandleRef = nullSelf;
4645
}
4746

48-
internal delegate UIntPtr OutStringMethod([In, Out] byte[] out_bytes,
49-
UIntPtr out_size);
47+
internal delegate UIntPtr OutStringMethod([In, Out] byte[] out_bytes,UIntPtr out_size);
5048

5149
internal static String OutParamsToString(OutStringMethod outStringMethod) {
5250
UIntPtr requiredSize = outStringMethod(null, UIntPtr.Zero);
@@ -58,8 +56,7 @@ internal static String OutParamsToString(OutStringMethod outStringMethod) {
5856
try {
5957
byte[] array = new byte[requiredSize.ToUInt32()];
6058
outStringMethod(array, requiredSize);
61-
str = Encoding.UTF8.GetString(array, 0,
62-
(int)requiredSize.ToUInt32() - 1);
59+
str = Encoding.UTF8.GetString(array, 0, (int)requiredSize.ToUInt32() - 1);
6360
} catch (Exception e) {
6461
Debug.LogError("Exception creating string from char array: " + e);
6562
str = string.Empty;

0 commit comments

Comments
 (0)