@@ -223,26 +223,47 @@ bool GoogleSignIn_Configure(void *unused, bool useGameSignIn,
223
223
* Sign-In. The return value is a pointer to the currentResult object.
224
224
*/
225
225
void *GoogleSignIn_SignIn () {
226
- SignInResult *result = startSignIn ();
227
- if (!result) {
228
- [[GIDSignIn sharedInstance ] signIn ];
229
- result = currentResult_.get ();
230
- }
231
- return result;
226
+ SignInResult *result = startSignIn ();
227
+ if (!result) {
228
+ [[GIDSignIn sharedInstance ] setClientID: @" 303413321002-osmliudj71vc5e0lqjd8l6mb137v0clj.apps.googleusercontent.com" ];
229
+ [[GIDSignIn sharedInstance ] signIn ];
230
+ result = currentResult_.get ();
231
+ }
232
+ return result;
232
233
}
234
+ /* 修改前版本*/
235
+ // void *GoogleSignIn_SignIn() {
236
+ // SignInResult *result = startSignIn();
237
+ // if (!result) {
238
+ // [[GIDSignIn sharedInstance] signIn];
239
+ // result = currentResult_.get();
240
+ // }
241
+ // return result;
242
+ // }
233
243
234
244
/* *
235
245
* Attempt a silent sign-in. Return value is the pointer to the currentResult
236
246
* object.
237
247
*/
238
248
void *GoogleSignIn_SignInSilently () {
239
- SignInResult *result = startSignIn ();
240
- if (!result) {
241
- [[GIDSignIn sharedInstance ] restorePreviousSignIn ];
242
- result = currentResult_.get ();
243
- }
244
- return result;
249
+ SignInResult *result = startSignIn ();
250
+ if (!result) {
251
+ [GIDSignIn sharedInstance ].presentingViewController = UnityGetGLViewController ();
252
+ [[GIDSignIn sharedInstance ] setClientID: @" 303413321002-osmliudj71vc5e0lqjd8l6mb137v0clj.apps.googleusercontent.com" ];
253
+ [[GIDSignIn sharedInstance ] restorePreviousSignIn ];
254
+ result = currentResult_.get ();
255
+ }
256
+ return result;
245
257
}
258
+ /* 修改前版本*/
259
+ // void *GoogleSignIn_SignInSilently() {
260
+ // SignInResult *result = startSignIn();
261
+ // if (!result) {
262
+ // [[GIDSignIn sharedInstance] restorePreviousSignIn];
263
+ // result = currentResult_.get();
264
+ // }
265
+ // return result;
266
+ // }
246
267
247
268
void GoogleSignIn_Signout () {
248
269
GIDSignIn *signIn = [GIDSignIn sharedInstance ];
0 commit comments