Skip to content

Commit 68622d8

Browse files
authored
Remove long-unused Iterable deep links handling (#24487)
* Remove long-unused Iterable deep links handling See pbMoDN-fd-p2#comment-7311 * Address main-thread sanitizer issue: change tab bar index on main thread * Push main queue dispatch from show notifications to deep link handler See comment here https://github.com/wordpress-mobile/WordPress-iOS/pull/24487/files#r2053393420 * Add assertion failure for deep link without URL
1 parent 70f7667 commit 68622d8

8 files changed

+18
-23
lines changed

Sources/Reader/Reader.entitlements

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<array>
77
<string>webcredentials:wordpress.com</string>
88
<string>webcredentials:*.wordpress.com</string>
9-
<string>applinks:links.wp.a8cmail.com</string>
109
</array>
1110
<key>aps-environment</key>
1211
<string>development</string>

WordPress/Classes/System/Root View/WPTabBarController+RootViewPresenter.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import UIKit
2+
import WordPressShared
23

34
/// `WPTabBarController` is used as the root presenter when Jetpack features are enabled
45
/// and the app's UI is normal.
@@ -22,8 +23,11 @@ extension WPTabBarController: RootViewPresenter {
2223
}
2324

2425
func showNotificationsTab(completion: ((NotificationsViewController) -> Void)?) {
25-
self.selectedIndex = WPTab.notifications.rawValue
26-
completion?(self.notificationsViewController!)
26+
// UITabBarController.selectedIndex must be used from main thread only.
27+
wpAssert(Thread.isMainThread)
28+
29+
selectedIndex = WPTab.notifications.rawValue
30+
completion?(notificationsViewController!)
2731
}
2832

2933
// MARK: Me

WordPress/Classes/System/WordPressAppDelegate.swift

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,9 @@ extension WordPressAppDelegate {
457457
}
458458

459459
trackDeepLink(for: url) { url in
460-
UniversalLinkRouter.shared.handle(url: url)
460+
DispatchQueue.main.async {
461+
UniversalLinkRouter.shared.handle(url: url)
462+
}
461463
}
462464
}
463465

@@ -473,24 +475,19 @@ extension WordPressAppDelegate {
473475
extension WordPressAppDelegate {
474476

475477
private func trackDeepLink(for url: URL, completion: @escaping ((URL) -> Void)) {
476-
guard isIterableDeepLink(url) else {
477-
completion(url)
478-
return
479-
}
480-
481-
let task = URLSession.shared.dataTask(with: url) {(_, response, error) in
482-
if let url = response?.url {
483-
completion(url)
478+
let task = URLSession.shared.dataTask(with: url) { _, response, error in
479+
guard let url = response?.url else {
480+
wpAssertionFailure(
481+
"Received a deep link response without URL attached.",
482+
userInfo: ["response": response ?? "no response"]
483+
)
484+
return
484485
}
486+
487+
completion(url)
485488
}
486489
task.resume()
487490
}
488-
489-
private func isIterableDeepLink(_ url: URL) -> Bool {
490-
return url.absoluteString.contains(WordPressAppDelegate.iterableDomain)
491-
}
492-
493-
private static let iterableDomain = "links.wp.a8cmail.com"
494491
}
495492

496493
// MARK: - Helpers

WordPress/Jetpack/JetpackDebug.entitlements

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
<string>applinks:wordpress.com</string>
1818
<string>applinks:*.wordpress.com</string>
1919
<string>applinks:public-api.wordpress.com</string>
20-
<string>applinks:links.wp.a8cmail.com</string>
2120
</array>
2221
<key>com.apple.security.application-groups</key>
2322
<array>

WordPress/Jetpack/JetpackRelease-Alpha.entitlements

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
<string>applinks:wordpress.com</string>
1414
<string>applinks:*.wordpress.com</string>
1515
<string>applinks:public-api.wordpress.com</string>
16-
<string>applinks:links.wp.a8cmail.com</string>
1716
</array>
1817
<key>com.apple.security.application-groups</key>
1918
<array>

WordPress/Jetpack/JetpackRelease.entitlements

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
<string>applinks:wordpress.com</string>
1818
<string>applinks:*.wordpress.com</string>
1919
<string>applinks:public-api.wordpress.com</string>
20-
<string>applinks:links.wp.a8cmail.com</string>
2120
</array>
2221
<key>com.apple.security.application-groups</key>
2322
<array>

WordPress/WordPress-Alpha.entitlements

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<array>
77
<string>webcredentials:wordpress.com</string>
88
<string>webcredentials:*.wordpress.com</string>
9-
<string>applinks:links.wp.a8cmail.com</string>
109
</array>
1110
<key>com.apple.security.application-groups</key>
1211
<array>

WordPress/WordPress.entitlements

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
<array>
1313
<string>webcredentials:wordpress.com</string>
1414
<string>webcredentials:*.wordpress.com</string>
15-
<string>applinks:links.wp.a8cmail.com</string>
1615
</array>
1716
<key>com.apple.developer.icloud-container-identifiers</key>
1817
<array>

0 commit comments

Comments
 (0)