-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2314 from CruGlobal/GT-2469-disable-firebase-mess…
…aging-in-ui-tests GT-2469 disable firebase messaging in UI tests
- Loading branch information
Showing
18 changed files
with
289 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,5 +14,6 @@ enum LaunchEnvironmentKey: String { | |
return rawValue | ||
} | ||
|
||
case appMessagingIsEnabled | ||
case urlDeeplink | ||
} |
36 changes: 36 additions & 0 deletions
36
godtools/App/Share/Application/LaunchEnvironment/LaunchEnvironmentReader.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// | ||
// LaunchEnvironmentReader.swift | ||
// godtools | ||
// | ||
// Created by Levi Eggert on 10/31/24. | ||
// Copyright © 2024 Cru. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
class LaunchEnvironmentReader { | ||
|
||
private let launchEnvironment: [String: String] | ||
|
||
init(launchEnvironment: [String: String]) { | ||
|
||
self.launchEnvironment = launchEnvironment | ||
} | ||
|
||
static func createFromProcessInfo() -> LaunchEnvironmentReader { | ||
return LaunchEnvironmentReader(launchEnvironment: ProcessInfo.processInfo.environment) | ||
} | ||
|
||
func getAppMessagingIsEnabled() -> Bool? { | ||
|
||
guard let stringBool = launchEnvironment[LaunchEnvironmentKey.appMessagingIsEnabled.value] else { | ||
return nil | ||
} | ||
|
||
return Bool(stringBool) | ||
} | ||
|
||
func getUrlDeepLink() -> String? { | ||
return launchEnvironment[LaunchEnvironmentKey.urlDeeplink.value] | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
godtools/App/Share/Application/LaunchEnvironment/LaunchEnvironmentWriter.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// | ||
// LaunchEnvironmentWriter.swift | ||
// godtools | ||
// | ||
// Created by Levi Eggert on 10/31/24. | ||
// Copyright © 2024 Cru. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
class LaunchEnvironmentWriter { | ||
|
||
init() { | ||
|
||
} | ||
|
||
func setAppMessagingIsEnabled(launchEnvironment: inout [String: String], enabled: Bool) { | ||
launchEnvironment[LaunchEnvironmentKey.appMessagingIsEnabled.value] = String(enabled) | ||
} | ||
|
||
func setUrlDeepLink(launchEnvironment: inout [String: String], url: String) { | ||
launchEnvironment[LaunchEnvironmentKey.urlDeeplink.value] = url | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
godtools/App/Share/Data/AppMessaging/AppMessagingDelegate.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// AppMessagingDelegate.swift | ||
// godtools | ||
// | ||
// Created by Levi Eggert on 10/30/24. | ||
// Copyright © 2024 Cru. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
protocol AppMessagingDelegate: AnyObject { | ||
|
||
func actionTappedWithUrl(url: URL) | ||
} |
16 changes: 16 additions & 0 deletions
16
godtools/App/Share/Data/AppMessaging/AppMessagingInterface.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// AppMessagingInterface.swift | ||
// godtools | ||
// | ||
// Created by Levi Eggert on 10/30/24. | ||
// Copyright © 2024 Cru. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
protocol AppMessagingInterface { | ||
|
||
var messagingDelegate: AppMessagingDelegate? { get } | ||
|
||
func setMessagingDelegate(messagingDelegate: AppMessagingDelegate?) | ||
} |
21 changes: 21 additions & 0 deletions
21
godtools/App/Share/Data/AppMessaging/DisabledInAppMessaging/DisabledInAppMessaging.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// | ||
// DisabledInAppMessaging.swift | ||
// godtools | ||
// | ||
// Created by Levi Eggert on 10/31/24. | ||
// Copyright © 2024 Cru. All rights reserved. | ||
// | ||
|
||
class DisabledInAppMessaging: AppMessagingInterface { | ||
|
||
private(set) weak var messagingDelegate: AppMessagingDelegate? | ||
|
||
init() { | ||
|
||
} | ||
|
||
func setMessagingDelegate(messagingDelegate: AppMessagingDelegate?) { | ||
|
||
// Won't do anything here. The purpose of this class is to provide a disabled in app messaging that does nothing. ~Levi | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.