diff --git a/StripeFinancialConnections/StripeFinancialConnections/Source/Native/Consent/ConsentViewController.swift b/StripeFinancialConnections/StripeFinancialConnections/Source/Native/Consent/ConsentViewController.swift index f92669b17b9..76fbea8a454 100644 --- a/StripeFinancialConnections/StripeFinancialConnections/Source/Native/Consent/ConsentViewController.swift +++ b/StripeFinancialConnections/StripeFinancialConnections/Source/Native/Consent/ConsentViewController.swift @@ -66,6 +66,10 @@ class ConsentViewController: UIViewController { required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } + + deinit { + NotificationCenter.default.removeObserver(self) + } override func viewDidLoad() { super.viewDidLoad() @@ -111,6 +115,19 @@ class ConsentViewController: UIViewController { // this fixes an issue where presenting a UIViewController // on top of ConsentViewController would stop the dot animation consentLogoView?.animateDots() + + NotificationCenter.default.addObserver( + self, + selector: #selector(appWillEnterForeground), + name: UIApplication.willEnterForegroundNotification, + object: nil + ) + } + + @objc private func appWillEnterForeground() { + // Fixes an issue where the dot animation was stopped when the app + // was backgrounded, then reopened. + consentLogoView?.animateDots() } private func didSelectAgree() {