Skip to content

Commit f438d4b

Browse files
committed
Move back jetpack deeplink scheme to the local file
1 parent 773488a commit f438d4b

File tree

3 files changed

+18
-29
lines changed

3 files changed

+18
-29
lines changed

WordPress/Classes/Utility/App Configuration/AppConstants.swift

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,6 @@ import WordPressAuthenticator
2727
#endif
2828
#endif
2929
#endif
30-
31-
/// Deep Link URL Scheme
32-
///
33-
/// Note: This needs to be manually in sync with Target > Build Settings > User-defined > `WPCOM_SCHEME`.
34-
///
35-
#if DEBUG
36-
static let deepLinkScheme = "wpdebug"
37-
#elseif INTERNAL_BUILD
38-
static let deepLinkScheme = "wpinternal"
39-
#elseif ALPHA_BUILD
40-
static let deepLinkScheme = "wpalpha"
41-
#else
42-
static let deepLinkScheme = "wordpress"
43-
#endif
4430
}
4531

4632
// MARK: - Tab bar order

WordPress/Classes/ViewRelated/Jetpack/Branding/Coordinator/JetpackBrandingCoordinator.swift

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,27 @@ import UIKit
33
/// A class containing convenience methods for the the Jetpack branding experience
44
class JetpackBrandingCoordinator {
55

6+
/// Used to "guess" if the Jetpack app is already installed.
7+
/// The check is done from the WordPress side.
8+
///
9+
/// Note: The string values should kept in-sync with Jetpack's URL scheme.
10+
///
11+
static var jetpackDeepLinkScheme: String {
12+
#if DEBUG
13+
return "jpdebug"
14+
#elseif INTERNAL_BUILD
15+
return "jpinternal"
16+
#elseif ALPHA_BUILD
17+
return "jpalpha"
18+
#else
19+
return "jetpack"
20+
#endif
21+
}
22+
623
static func presentOverlay(from viewController: UIViewController, redirectAction: (() -> Void)? = nil) {
724

825
let action = redirectAction ?? {
9-
guard let jetpackDeepLinkURL = URL(string: "\(AppConstants.deepLinkScheme)://app"),
26+
guard let jetpackDeepLinkURL = URL(string: "\(jetpackDeepLinkScheme)://app"),
1027
let jetpackUniversalLinkURL = URL(string: "https://jetpack.com/app"),
1128
let jetpackAppStoreURL = URL(string: "https://apps.apple.com/app/jetpack-website-builder/id1565481562") else {
1229
return

WordPress/Jetpack/AppConstants.swift

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,6 @@ import WordPressKit
2727
#endif
2828
#endif
2929
#endif
30-
31-
/// Deep Link URL Scheme
32-
///
33-
/// Note: this needs to be in sync with Target > Build Settings > User-defined > `WPCOM_SCHEME` value.
34-
///
35-
#if DEBUG
36-
static let deepLinkScheme = "jpdebug"
37-
#elseif INTERNAL_BUILD
38-
static let deepLinkScheme = "jpinternal"
39-
#elseif ALPHA_BUILD
40-
static let deepLinkScheme = "jpalpha"
41-
#else
42-
static let deepLinkScheme = "jetpack"
43-
#endif
4430
}
4531

4632
// MARK: - Tab bar order

0 commit comments

Comments
 (0)