diff --git a/Podfile b/Podfile index 780700af5f3b..56dfd24a01a6 100644 --- a/Podfile +++ b/Podfile @@ -232,8 +232,8 @@ abstract_target 'Apps' do pod 'Gridicons', '~> 1.1.0' - pod 'WordPressAuthenticator', '~> 5.6-beta' - # pod 'WordPressAuthenticator', git: 'https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git', branch: 'trunk' + pod 'WordPressAuthenticator', '~> 6.0-beta' + # pod 'WordPressAuthenticator', git: 'https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git', branch: '' # pod 'WordPressAuthenticator', git: 'https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git', commit: '' # pod 'WordPressAuthenticator', path: '../WordPressAuthenticator-iOS' diff --git a/Podfile.lock b/Podfile.lock index a0c02540c6a5..5e7a1bad276f 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -503,7 +503,7 @@ PODS: - WordPress-Aztec-iOS (1.19.8) - WordPress-Editor-iOS (1.19.8): - WordPress-Aztec-iOS (= 1.19.8) - - WordPressAuthenticator (5.7.0): + - WordPressAuthenticator (6.0.0): - GoogleSignIn (~> 6.0.1) - Gridicons (~> 1.0) - "NSURL+IDN (= 0.4)" @@ -611,7 +611,7 @@ DEPENDENCIES: - SVProgressHUD (= 2.2.5) - SwiftLint (~> 0.50) - WordPress-Editor-iOS (~> 1.19.8) - - WordPressAuthenticator (~> 5.6-beta) + - WordPressAuthenticator (~> 6.0-beta) - WordPressKit (~> 7.0.0-beta) - WordPressShared (~> 2.0-beta) - WordPressUI (~> 1.12.5) @@ -622,7 +622,7 @@ DEPENDENCIES: SPEC REPOS: https://github.com/wordpress-mobile/cocoapods-specs.git: - - WordPressAuthenticator + - WordPressShared trunk: - Alamofire - AlamofireImage @@ -660,8 +660,8 @@ SPEC REPOS: - UIDeviceIdentifier - WordPress-Aztec-iOS - WordPress-Editor-iOS + - WordPressAuthenticator - WordPressKit - - WordPressShared - WordPressUI - WPMediaPicker - wpxmlrpc @@ -880,9 +880,9 @@ SPEC CHECKSUMS: UIDeviceIdentifier: e6a801d25f4f178de5bdf475ffe29050d0148176 WordPress-Aztec-iOS: 7d11d598f14c82c727c08b56bd35fbeb7dafb504 WordPress-Editor-iOS: 9eb9f12f21a5209cb837908d81ffe1e31cb27345 - WordPressAuthenticator: fc22569ef113e728823418120014725a7fdee8df + WordPressAuthenticator: b93b797eae278f7cda42693a652329173f1d5423 WordPressKit: a161c49306369cfa22c648866cee5aba16d7cbac - WordPressShared: 0aa459e5257a77184db87805a998f447443c9706 + WordPressShared: 8e59bc8cec256f54a7c4cc6c94911adc2a9a65d2 WordPressUI: c5be816f6c7b3392224ac21de9e521e89fa108ac WPMediaPicker: 0d45dfd7b3c5651c5236ffd48c1b0b2f60a2d5d2 wpxmlrpc: 68db063041e85d186db21f674adf08d9c70627fd @@ -896,6 +896,6 @@ SPEC CHECKSUMS: ZendeskSupportSDK: 3a8e508ab1d9dd22dc038df6c694466414e037ba ZIPFoundation: ae5b4b813d216d3bf0a148773267fff14bd51d37 -PODFILE CHECKSUM: 63504603fd92b4077b1a9556356336a69e571422 +PODFILE CHECKSUM: e8074cd059cc2018e1e491754ebaa6d098c5432e COCOAPODS: 1.11.3 diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index 29dfa83034c5..75faba46a703 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -7,6 +7,8 @@ * [**] [internal] Refactor updating account related Core Data operations, which ususally happens during log in and out of the app. [#20394] * [***] [internal] Refactor uploading photos (from the device photo, the Free Photo library, and other sources) to the WordPress Media Library. Affected areas are where you can choose a photo and upload, including the "Media" screen, adding images to a post, updating site icon, etc. [#20322] * [**] [WordPress-only] Warns user about sites with only individual plugins not supporting core app features and offers the option to switch to the Jetpack app. [#20408] +* [**] Add a "Personalize Home Tab" button to the bottom of the Home tab that allows changing cards visibility. [#20369] +* [**] [internal] Refactored Google SignIn implementation to not use the Google SDK [#20128] 22.0 ----- diff --git a/WordPress/Classes/Utility/App Configuration/AppDependency.swift b/WordPress/Classes/Utility/App Configuration/AppDependency.swift index f95d642e0225..68f640b81a16 100644 --- a/WordPress/Classes/Utility/App Configuration/AppDependency.swift +++ b/WordPress/Classes/Utility/App Configuration/AppDependency.swift @@ -5,7 +5,10 @@ import Foundation /// Make sure to keep them in sync to avoid build errors when builing the Jetpack target. @objc class AppDependency: NSObject { static func authenticationManager(windowManager: WindowManager) -> WordPressAuthenticationManager { - return WordPressAuthenticationManager(windowManager: windowManager) + return WordPressAuthenticationManager( + windowManager: windowManager, + remoteFeaturesStore: RemoteFeatureFlagStore() + ) } static func windowManager(window: UIWindow) -> WindowManager { diff --git a/WordPress/Classes/Utility/BuildInformation/RemoteFeatureFlag.swift b/WordPress/Classes/Utility/BuildInformation/RemoteFeatureFlag.swift index 4ebb33a35cdc..100cea1126ec 100644 --- a/WordPress/Classes/Utility/BuildInformation/RemoteFeatureFlag.swift +++ b/WordPress/Classes/Utility/BuildInformation/RemoteFeatureFlag.swift @@ -16,6 +16,7 @@ enum RemoteFeatureFlag: Int, CaseIterable { case directDomainsPurchaseDashboardCard case pagesDashboardCard case activityLogDashboardCard + case sdkLessGoogleSignIn var defaultValue: Bool { switch self { @@ -47,6 +48,8 @@ enum RemoteFeatureFlag: Int, CaseIterable { return false case .activityLogDashboardCard: return false + case .sdkLessGoogleSignIn: + return false } } @@ -81,6 +84,8 @@ enum RemoteFeatureFlag: Int, CaseIterable { return "dashboard_card_pages" case .activityLogDashboardCard: return "dashboard_card_activity_log" + case .sdkLessGoogleSignIn: + return "google_signin_without_sdk" } } @@ -114,6 +119,8 @@ enum RemoteFeatureFlag: Int, CaseIterable { return "Pages Dashboard Card" case .activityLogDashboardCard: return "Activity Log Dashboard Card" + case .sdkLessGoogleSignIn: + return "Sign-In with Google without the Google SDK" } } diff --git a/WordPress/Classes/ViewRelated/NUX/LoginEpilogueUserInfo.swift b/WordPress/Classes/ViewRelated/NUX/LoginEpilogueUserInfo.swift index 203a26e14aa5..f2bb616004fa 100644 --- a/WordPress/Classes/ViewRelated/NUX/LoginEpilogueUserInfo.swift +++ b/WordPress/Classes/ViewRelated/NUX/LoginEpilogueUserInfo.swift @@ -49,13 +49,7 @@ extension LoginEpilogueUserInfo { /// Updates the Epilogue properties, given a SocialService instance. /// mutating func update(with service: SocialService) { - switch service { - case .google(let user): - fullName = user.profile?.name ?? String() - email = user.profile?.email ?? String() - case .apple(let user): - fullName = user.fullName - email = user.email - } + fullName = service.user.fullName + email = service.user.email } } diff --git a/WordPress/Classes/ViewRelated/NUX/WordPressAuthenticationManager.swift b/WordPress/Classes/ViewRelated/NUX/WordPressAuthenticationManager.swift index 36f33f32196e..c919fccb2d84 100644 --- a/WordPress/Classes/ViewRelated/NUX/WordPressAuthenticationManager.swift +++ b/WordPress/Classes/ViewRelated/NUX/WordPressAuthenticationManager.swift @@ -19,14 +19,18 @@ class WordPressAuthenticationManager: NSObject { private let recentSiteService: RecentSitesService + private let remoteFeaturesStore: RemoteFeatureFlagStore + init(windowManager: WindowManager, authenticationHandler: AuthenticationHandler? = nil, quickStartSettings: QuickStartSettings = QuickStartSettings(), - recentSiteService: RecentSitesService = RecentSitesService()) { + recentSiteService: RecentSitesService = RecentSitesService(), + remoteFeaturesStore: RemoteFeatureFlagStore) { self.windowManager = windowManager self.authenticationHandler = authenticationHandler self.quickStartSettings = quickStartSettings self.recentSiteService = recentSiteService + self.remoteFeaturesStore = remoteFeaturesStore } /// Support is only available to the WordPress iOS App. Our Authentication Framework doesn't have direct access. @@ -59,6 +63,16 @@ extension WordPressAuthenticationManager { // Ref https://github.com/wordpress-mobile/WordPress-iOS/pull/12332#issuecomment-521994963 let enableSignInWithApple = !(BuildConfiguration.current ~= [.a8cBranchTest, .a8cPrereleaseTesting]) + let googleLogingWithoutSDK: Bool = { + switch BuildConfiguration.current { + case .appStore: + // Rely on the remote flag in production + return RemoteFeatureFlag.sdkLessGoogleSignIn.enabled(using: remoteFeaturesStore) + default: + return true + } + }() + return WordPressAuthenticatorConfiguration(wpcomClientId: ApiCredentials.client, wpcomSecret: ApiCredentials.secret, wpcomScheme: WPComScheme, @@ -75,7 +89,8 @@ extension WordPressAuthenticationManager { enableSignupWithGoogle: AppConfiguration.allowSignUp, enableUnifiedAuth: true, enableUnifiedCarousel: FeatureFlag.unifiedPrologueCarousel.enabled, - enableSocialLogin: true) + enableSocialLogin: true, + googleLoginWithoutSDK: googleLogingWithoutSDK) } private func authenticatorStyle() -> WordPressAuthenticatorStyle { diff --git a/WordPress/Jetpack/AppDependency.swift b/WordPress/Jetpack/AppDependency.swift index eafb824faa5a..a0a2e67395e3 100644 --- a/WordPress/Jetpack/AppDependency.swift +++ b/WordPress/Jetpack/AppDependency.swift @@ -5,7 +5,11 @@ import Foundation /// Make sure to keep them in sync to avoid build errors when builing the WordPress target. @objc class AppDependency: NSObject { static func authenticationManager(windowManager: WindowManager) -> WordPressAuthenticationManager { - return WordPressAuthenticationManager(windowManager: windowManager, authenticationHandler: JetpackAuthenticationManager()) + return WordPressAuthenticationManager( + windowManager: windowManager, + authenticationHandler: JetpackAuthenticationManager(), + remoteFeaturesStore: RemoteFeatureFlagStore() + ) } static func windowManager(window: UIWindow) -> WindowManager { diff --git a/WordPress/WordPressTest/PrepublishingNudgesViewControllerTests.swift b/WordPress/WordPressTest/PrepublishingNudgesViewControllerTests.swift index 05c05b40cde1..61a236108ecc 100644 --- a/WordPress/WordPressTest/PrepublishingNudgesViewControllerTests.swift +++ b/WordPress/WordPressTest/PrepublishingNudgesViewControllerTests.swift @@ -12,7 +12,10 @@ class PrepublishingNudgesViewControllerTests: XCTestCase { /// We need that in order to initialize the Authenticator, otherwise this test crashes /// This is because we're using the NUXButton. Ideally, that component should be extracted - WordPressAuthenticationManager(windowManager: windowManager).initializeWordPressAuthenticator() + WordPressAuthenticationManager( + windowManager: windowManager, + remoteFeaturesStore: RemoteFeatureFlagStore() + ).initializeWordPressAuthenticator() } /// Call the completion block when the "Publish" button is pressed