Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update iOS pod to >= 5.0.0 and apply migrations for native plugin code. #126

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<!-- iOS Cocoapod dependencies can be specified by each iosPod element. -->
<iosPods>
<iosPod name="GoogleSignIn" version=">= 4.0.2" bitcodeEnabled="false"
<iosPod name="GoogleSignIn" version="~> 5.0.0" bitcodeEnabled="false"
minTargetSdk="6.0">
</iosPod>
</iosPods>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
*/
#import <GoogleSignIn/GIDSignIn.h>
@interface GoogleSignInHandler
: NSObject <GIDSignInDelegate, GIDSignInUIDelegate>
: NSObject <GIDSignInDelegate>

@end
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,6 @@ - (void)signIn:(GIDSignIn *)signIn
case kGIDSignInErrorCodeKeychain:
currentResult_->result_code = kStatusCodeInternalError;
break;
case kGIDSignInErrorCodeNoSignInHandlersInstalled:
currentResult_->result_code = kStatusCodeDeveloperError;
break;
case kGIDSignInErrorCodeHasNoAuthInKeychain:
currentResult_->result_code = kStatusCodeError;
break;
Expand Down Expand Up @@ -192,6 +189,8 @@ bool GoogleSignIn_Configure(void *unused, bool useGameSignIn,
[NSString stringWithUTF8String:accountName];
}

[GIDSignIn sharedInstance].presentingViewController = UnityGetGLViewController();

return !useGameSignIn;
}

Expand Down Expand Up @@ -239,7 +238,7 @@ bool GoogleSignIn_Configure(void *unused, bool useGameSignIn,
void *GoogleSignIn_SignInSilently() {
SignInResult *result = startSignIn();
if (!result) {
[[GIDSignIn sharedInstance] signInSilently];
[[GIDSignIn sharedInstance] restorePreviousSignIn];
result = currentResult_.get();
}
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ - (BOOL)GoogleSignInAppController:(UIApplication *)application
// Setup the Sign-In instance.
GIDSignIn *signIn = [GIDSignIn sharedInstance];
signIn.clientID = clientId;
signIn.uiDelegate = gsiHandler;
signIn.delegate = gsiHandler;

// looks like it's just calling itself, but the implementations were swapped
Expand All @@ -96,9 +95,7 @@ - (BOOL)GoogleSignInAppController:(UIApplication *)application
sourceApplication:sourceApplication
annotation:annotation];

return [[GIDSignIn sharedInstance] handleURL:url
sourceApplication:sourceApplication
annotation:annotation] ||
return [[GIDSignIn sharedInstance] handleURL:url] ||
handled;
}

Expand All @@ -112,12 +109,7 @@ - (BOOL)GoogleSignInAppController:(UIApplication *)app
BOOL handled =
[self GoogleSignInAppController:app openURL:url options:options];

return [[GIDSignIn sharedInstance]
handleURL:url
sourceApplication:
options[UIApplicationOpenURLOptionsSourceApplicationKey]
annotation:
options[UIApplicationOpenURLOptionsAnnotationKey]] ||
return [[GIDSignIn sharedInstance] handleURL:url] ||
handled;
}

Expand Down