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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

MBL-1234: 馃槈 #1964

Merged
merged 2 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 0 additions & 4 deletions Configs/Secrets.swift.example
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ public enum Secrets {
public static let password = "pswd"
}

public enum PerimeterX {
public static let appId = "deadbeef"
}

public enum Segment {
public static let staging = "write-key-staging"
public static let production = "write-key-production"
Expand Down
6 changes: 0 additions & 6 deletions Kickstarter-iOS/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,6 @@ internal final class AppDelegate: UIResponder, UIApplicationDelegate {
.messageBannerViewController?.showBanner(with: success ? .success : .error, message: message)
}

self.viewModel.outputs.configurePerimeterX
.observeValues {
AppEnvironment.current.apiService.perimeterXClient
.start(policyDomains: [AppEnvironment.current.apiService.serverConfig.apiBaseUrl.host ?? ""])
}

NotificationCenter.default
.addObserver(forName: Notification.Name.ksr_sessionStarted, object: nil, queue: nil) { [weak self] _ in
self?.viewModel.inputs.userSessionStarted()
Expand Down
6 changes: 0 additions & 6 deletions Kickstarter-iOS/AppDelegateViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,6 @@ public protocol AppDelegateViewModelOutputs {
/// Emits when the application should configure Firebase
var configureFirebase: Signal<(), Never> { get }

/// Emits when the application should configure Perimeter X
var configurePerimeterX: Signal<(), Never> { get }

/// Emits when the application should configure Segment with an instance of Braze.
var configureSegmentWithBraze: Signal<String, Never> { get }

Expand Down Expand Up @@ -688,8 +685,6 @@ public final class AppDelegateViewModel: AppDelegateViewModelType, AppDelegateVi

self.configureFirebase = self.applicationLaunchOptionsProperty.signal.ignoreValues()

self.configurePerimeterX = self.applicationLaunchOptionsProperty.signal.ignoreValues()

self.configureAppCenterWithData = Signal.merge(
self.applicationLaunchOptionsProperty.signal.ignoreValues(),
self.userSessionStartedProperty.signal,
Expand Down Expand Up @@ -904,7 +899,6 @@ public final class AppDelegateViewModel: AppDelegateViewModelType, AppDelegateVi
public let applicationIconBadgeNumber: Signal<Int, Never>
public let configureAppCenterWithData: Signal<AppCenterConfigData, Never>
public let configureFirebase: Signal<(), Never>
public let configurePerimeterX: Signal<(), Never>
public let configureSegmentWithBraze: Signal<String, Never>
public let continueUserActivityReturnValue = MutableProperty(false)
public let emailVerificationCompleted: Signal<(String, Bool), Never>
Expand Down
10 changes: 0 additions & 10 deletions Kickstarter-iOS/AppDelegateViewModelTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ final class AppDelegateViewModelTests: TestCase {
private let applicationIconBadgeNumber = TestObserver<Int, Never>()
private let configureAppCenterWithData = TestObserver<AppCenterConfigData, Never>()
private let configureFirebase = TestObserver<(), Never>()
private let configurePerimeterX = TestObserver<(), Never>()
private let configureSegmentWithBraze = TestObserver<String, Never>()
private let didAcceptReceivingRemoteNotifications = TestObserver<(), Never>()
private let emailVerificationCompletedMessage = TestObserver<String, Never>()
Expand All @@ -27,8 +26,6 @@ final class AppDelegateViewModelTests: TestCase {
private let goToProfile = TestObserver<(), Never>()
private let goToMobileSafari = TestObserver<URL, Never>()
private let goToSearch = TestObserver<(), Never>()
private let perimeterXManagerReady = TestObserver<[String: String]?, Never>()
private let perimeterXRefreshedHeaders = TestObserver<[String: String]?, Never>()
private let postNotificationName = TestObserver<Notification.Name, Never>()
private let presentViewController = TestObserver<Int, Never>()
private let pushRegistrationStarted = TestObserver<(), Never>()
Expand Down Expand Up @@ -60,7 +57,6 @@ final class AppDelegateViewModelTests: TestCase {
self.vm.outputs.applicationIconBadgeNumber.observe(self.applicationIconBadgeNumber.observer)
self.vm.outputs.configureAppCenterWithData.observe(self.configureAppCenterWithData.observer)
self.vm.outputs.configureFirebase.observe(self.configureFirebase.observer)
self.vm.outputs.configurePerimeterX.observe(self.configurePerimeterX.observer)
self.vm.outputs.configureSegmentWithBraze.observe(self.configureSegmentWithBraze.observer)
self.vm.outputs.emailVerificationCompleted.map(first)
.observe(self.emailVerificationCompletedMessage.observer)
Expand Down Expand Up @@ -144,12 +140,6 @@ final class AppDelegateViewModelTests: TestCase {
self.configureFirebase.assertValueCount(1)
}

func testConfigurePerimeterX() {
self.vm.inputs.applicationDidFinishLaunching(application: UIApplication.shared, launchOptions: nil)

self.configurePerimeterX.assertValueCount(1)
}

// MARK: - AppCenter

func testConfigureAppCenter_AlphaApp_LoggedOut() {
Expand Down
5 changes: 0 additions & 5 deletions Kickstarter-iOS/Library/WebViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,6 @@ internal class WebViewController: UIViewController {
decidePolicyFor _: WKNavigationResponse,
decisionHandler: @escaping (WKNavigationResponsePolicy) -> Void
) {
if let newCookie = AppEnvironment.current.apiService.perimeterXClient.cookie {
self.webKitCookieStore?.setCookie(newCookie, completionHandler: {
print("Perimeter X mobile VID cookie set.")
})
}
decisionHandler(.allow)
}
}
Expand Down