diff --git a/WordPress/Classes/Utility/BuildInformation/FeatureFlag.swift b/WordPress/Classes/Utility/BuildInformation/FeatureFlag.swift index 5a1a17c9e0b8..d6ff545b94f7 100644 --- a/WordPress/Classes/Utility/BuildInformation/FeatureFlag.swift +++ b/WordPress/Classes/Utility/BuildInformation/FeatureFlag.swift @@ -157,7 +157,15 @@ enum FeatureFlag: Int, CaseIterable, OverrideableFlag { case .readerUserBlocking: return true case .sdkLessGoogleSignIn: - return true + switch BuildConfiguration.current { + case .appStore: + // This flag has a remote counterpart that should take precendence. + // But if that doesn't happen, we play it safe and stick with the SDK in production. + return false + case _: + // While using internal builds, leave it on by default + return true + } } } diff --git a/WordPress/Classes/ViewRelated/NUX/WordPressAuthenticationManager.swift b/WordPress/Classes/ViewRelated/NUX/WordPressAuthenticationManager.swift index cea2dc7a2562..c9ba992b14c3 100644 --- a/WordPress/Classes/ViewRelated/NUX/WordPressAuthenticationManager.swift +++ b/WordPress/Classes/ViewRelated/NUX/WordPressAuthenticationManager.swift @@ -59,6 +59,17 @@ 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 RemoteFeatureFlagStore().value(for: FeatureFlag.sdkLessGoogleSignIn) + case _: + // Do whatever is hardcoded or overridden on device in non-production builds + return FeatureFlag.sdkLessGoogleSignIn.enabled + } + }() + return WordPressAuthenticatorConfiguration(wpcomClientId: ApiCredentials.client, wpcomSecret: ApiCredentials.secret, wpcomScheme: WPComScheme, @@ -76,7 +87,7 @@ extension WordPressAuthenticationManager { enableUnifiedAuth: true, enableUnifiedCarousel: FeatureFlag.unifiedPrologueCarousel.enabled, enableSocialLogin: true, - googleLoginWithoutSDK: FeatureFlag.sdkLessGoogleSignIn.enabled) + googleLoginWithoutSDK: googleLogingWithoutSDK) } private func authenticatorStyle() -> WordPressAuthenticatorStyle {