ios端google;修改ios打包时pod数据源为清华

This commit is contained in:
Caiyanpeng committed 2022-01-20 16:30:58 +08:00
1 parent 58a8233697
commit 7bb5bafbd2
14 files changed
+143 -9

No files matched your search

+25
View File
@@ -40,7 +40,27 @@ static AppleAuth * _appleAuth;
[authorizationController performRequests];
}
}
- (void) authorizationGoogleID{
NSLog(@"cypgoogle");
GIDConfiguration *config = [[GIDConfiguration alloc] initWithClientID:[FIRApp defaultApp].options.clientID];
__weak __auto_type weakSelf = self;
UnityAppController * root = (UnityAppController*)[UIApplication sharedApplication].delegate;
[GIDSignIn.sharedInstance signInWithConfiguration:config presentingViewController:root.rootViewController callback:^(GIDGoogleUser * _Nullable user, NSError * _Nullable error) {
__auto_type strongSelf = weakSelf;
if (strongSelf == nil) { return; }
if (error == nil) {
GIDAuthentication *authentication = user.authentication;
UnitySendMessage("LoginPanel", "OnMobileGoogleLoginResp", [NSString stringWithFormat:@"true;%@|%@",user.userID,authentication.idToken ].UTF8String);
// FIRAuthCredential *credential =
// [FIRGoogleAuthProvider credentialWithIDToken:authentication.idToken
// accessToken:authentication.accessToken];
// ...
} else {
// ...
}
}];
}
#pragma mark- ASAuthorizationControllerDelegate
// 授权成功
- (void)authorizationController:(ASAuthorizationController *)controller didCompleteWithAuthorization:(ASAuthorization *)authorization API_AVAILABLE(ios(13.0)) {
@@ -121,4 +141,9 @@ static AppleAuth * _appleAuth;
void authorizationAppleID(){
AppleAuth * a = [AppleAuth instance];
[a authorizationAppleID];
}
void authorizationGoogleID(){
AppleAuth * a = [AppleAuth instance];
[a authorizationGoogleID];
}