فهرست منبع

Merge branch 'main' into GIDGoogleUser-restructure

pinlu 3 سال پیش
والد
کامیت
c8060d3f8f

+ 4 - 0
CHANGELOG.md

@@ -1,3 +1,7 @@
+# 6.2.3 (2022-8-18)
+- Fix resource loading in GoogleSignInSwift with CocoaPods use_frameworks! ([#197](https://github.com/google/GoogleSignIn-iOS/pull/197))
+- Prevent build errors for GoogleSignInSwift in certain scenarios when using Swift Package Manager. ([#166](https://github.com/google/GoogleSignIn-iOS/pull/166))
+
 # 6.2.2 (2022-5-27)
 - Prevent build errors for GoogleSignInSwift when using Swift Package Manager. ([#157](https://github.com/google/GoogleSignIn-iOS/pull/157))
 - Prevent a build error on Xcode 12 and earlier. ([#158](https://github.com/google/GoogleSignIn-iOS/pull/158))

+ 1 - 1
GoogleSignIn.podspec

@@ -1,6 +1,6 @@
 Pod::Spec.new do |s|
   s.name             = 'GoogleSignIn'
-  s.version          = '6.2.2'
+  s.version          = '6.2.3'
   s.summary          = 'Enables iOS apps to sign in with Google.'
   s.description      = <<-DESC
 The Google Sign-In SDK allows users to sign in with their Google account from third-party apps.

+ 2 - 1
GoogleSignInSwift/Sources/GoogleSignInButtonBundleExtensions.swift

@@ -17,6 +17,7 @@
 #if !arch(arm) && !arch(i386)
 
 import Foundation
+import GoogleSignIn
 
 // MARK: - Bundle Extensions
 
@@ -40,7 +41,7 @@ extension Bundle {
       return Bundle(path: mainPath)
     }
 
-    let classBundle = Bundle(for: GoogleSignInButtonViewModel.self)
+    let classBundle = Bundle(for: GIDSignIn.self)
 
     if let classPath = classBundle.path(
       forResource: GoogleSignInBundleName,

+ 34 - 0
GoogleSignInSwift/Tests/Unit/GoogleSignInButtonExtensionsTests.swift

@@ -0,0 +1,34 @@
+/*
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import XCTest
+import SwiftUI
+@testable import GoogleSignInSwift
+
+@available(iOS 13.0, macOS 10.15, *)
+class GoogleSignInButtonExtensionsTests: XCTestCase {
+
+  func testThatBundleExtensionReturnsImageIconURL() {
+    let googleIcon = Bundle.urlForGoogleResource(name: googleImageName, withExtension: "png")
+    XCTAssertNotNil(googleIcon)
+  }
+
+  func testThatBundleExtensionReturnsFontURL() {
+    let googleFont = Bundle.urlForGoogleResource(name: fontNameRobotoBold, withExtension: "ttf")
+    XCTAssertNotNil(googleFont)
+  }
+
+}

+ 1 - 1
GoogleSignInSwiftSupport.podspec

@@ -1,6 +1,6 @@
 Pod::Spec.new do |s|
   s.name = 'GoogleSignInSwiftSupport'
-  s.version = '6.2.2'
+  s.version = '6.2.3'
   s.swift_version = '4.0'
   s.summary = 'Adds Swift-focused support for Google Sign-In.'
   s.description = 'Additional Swift support for the Google Sign-In SDK.'

+ 1 - 1
Package.swift

@@ -17,7 +17,7 @@
 
 import PackageDescription
 
-let googleSignInVersion = "6.2.2"
+let googleSignInVersion = "6.2.3"
 
 let package = Package(
   name: "GoogleSignIn",

+ 2 - 2
Samples/ObjC/SignInSample/Source/AppDelegate.m

@@ -30,8 +30,8 @@
   // succeeds, we'll have a currentUser and the view will be able to draw its UI for the signed-in
   // state.  If the restore fails, currentUser will be nil and we'll draw the signed-out state
   // prompting the user to sign in.
-  [GIDSignIn.sharedInstance restorePreviousSignInWithCallback:^(GIDGoogleUser * _Nullable user,
-                                                                NSError * _Nullable error) {
+  [GIDSignIn.sharedInstance restorePreviousSignInWithCompletion:^(GIDGoogleUser *user,
+                                                                  NSError *error) {
     self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
     SignInViewController *masterViewController =
         [[SignInViewController alloc] initWithNibName:@"SignInViewController" bundle:nil];

+ 3 - 3
Samples/ObjC/SignInSample/Source/SignInViewController.m

@@ -259,7 +259,7 @@ static NSString * const kClientID =
 - (IBAction)signIn:(id)sender {
   [GIDSignIn.sharedInstance signInWithConfiguration:_configuration
                            presentingViewController:self
-                                           callback:^(GIDUserAuth *_Nullable userAuth,
+                                         completion:^(GIDUserAuth *_Nullable userAuth,
                                                       NSError *_Nullable error) {
     if (error) {
       self->_signInAuthStatus.text =
@@ -278,7 +278,7 @@ static NSString * const kClientID =
 }
 
 - (IBAction)disconnect:(id)sender {
-  [GIDSignIn.sharedInstance disconnectWithCallback:^(NSError *_Nullable error) {
+  [GIDSignIn.sharedInstance disconnectWithCompletion:^(NSError *error) {
     if (error) {
       self->_signInAuthStatus.text = [NSString stringWithFormat:@"Status: Failed to disconnect: %@",
                                       error];
@@ -293,7 +293,7 @@ static NSString * const kClientID =
 - (IBAction)addScopes:(id)sender {
   [GIDSignIn.sharedInstance addScopes:@[ @"https://www.googleapis.com/auth/user.birthday.read" ]
              presentingViewController:self
-                             callback:^(GIDUserAuth *_Nullable userAuth,
+                           completion:^(GIDUserAuth *_Nullable userAuth,
                                         NSError *_Nullable error) {
     if (error) {
       self->_signInAuthStatus.text = [NSString stringWithFormat:@"Status: Failed to add scopes: %@",