@@ -223,26 +223,47 @@ bool GoogleSignIn_Configure(void *unused, bool useGameSignIn,
223223 * Sign-In. The return value is a pointer to the currentResult object.
224224 */
225225void *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;
232233}
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+ // }
233243
234244/* *
235245 * Attempt a silent sign-in. Return value is the pointer to the currentResult
236246 * object.
237247 */
238248void *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;
245257}
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+ // }
246267
247268void GoogleSignIn_Signout () {
248269 GIDSignIn *signIn = [GIDSignIn sharedInstance ];
0 commit comments