Skip to content

Commit c593493

Browse files
committed
more logging on universal links example
1 parent 604368f commit c593493

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

bk2ch24p846UniversalLinksTest/UniversalLinksTest.xcodeproj/project.pbxproj

+2
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@
292292
CODE_SIGN_STYLE = Automatic;
293293
DEVELOPMENT_TEAM = W3LHX5RGV2;
294294
INFOPLIST_FILE = UniversalLinksTest/Info.plist;
295+
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
295296
LD_RUNPATH_SEARCH_PATHS = (
296297
"$(inherited)",
297298
"@executable_path/Frameworks",
@@ -312,6 +313,7 @@
312313
CODE_SIGN_STYLE = Automatic;
313314
DEVELOPMENT_TEAM = W3LHX5RGV2;
314315
INFOPLIST_FILE = UniversalLinksTest/Info.plist;
316+
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
315317
LD_RUNPATH_SEARCH_PATHS = (
316318
"$(inherited)",
317319
"@executable_path/Frameworks",

bk2ch24p846UniversalLinksTest/UniversalLinksTest/AppDelegate.swift

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import UIKit
55
@main
66
class AppDelegate: UIResponder, UIApplicationDelegate {
77

8-
9-
108
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
119
// Override point for customization after application launch.
1210
return true

bk2ch24p846UniversalLinksTest/UniversalLinksTest/SceneDelegate.swift

+12
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,15 @@
33
import UIKit
44
import os
55

6+
@available(iOS 14.0, *)
67
let logger = Logger(subsystem: "universalLinksTest", category: "link")
78

9+
func delay(_ delay:Double, closure:@escaping ()->()) {
10+
let when = DispatchTime.now() + delay
11+
DispatchQueue.main.asyncAfter(deadline: when, execute: closure)
12+
}
13+
14+
@available(iOS 14.0, *)
815
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
916

1017
var window: UIWindow?
@@ -16,13 +23,18 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
1623
}
1724

1825
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
26+
logger.log("launching")
1927
if let url = connectionOptions.userActivities.first?.webpageURL {
2028
logger.log("got universal link on launch: \(url.path)")
29+
delay(2) {
30+
self.show(url)
31+
}
2132
}
2233
}
2334

2435
func scene(_ scene: UIScene, continue userActivity: NSUserActivity) {
2536
if let url = userActivity.webpageURL {
37+
logger.log("continuing")
2638
self.show(url)
2739
}
2840
}

0 commit comments

Comments
 (0)