After following a tutorial about how to use SwiftUI in combination with Handoff I got this as result, but this isn't working for me. After trying a lot it seems like the OnContinueUserActivity is not called. The icon for handoff shows but once clicked on it, nothing happens. How can I fix this?
Code Block import SwiftUI struct Board: View { @State var BoardId: String var body: some View { VStack{ Text("Board: \(BoardId)") }.onContinueUserActivity("bundleIdentifier.Board", perform: { userActivity in print("Handoff starting...") if let Board = userActivity.userInfo?["Board"] as? String { // Load handoff page self.BoardId = Board } logUserActivity(userActivity, label: "on activity") }) .userActivity("bundleIdentifier.Board", element: BoardId) {Board, activity in let bundleid = Bundle.main.bundleIdentifier ?? "" activity.addUserInfoEntries(from: ["Board": BoardId, "setby": bundleid]) logUserActivity(activity, label: "activity") } } } struct Board_Previews: PreviewProvider { static var previews: some View { Board(BoardId: "NaN") } } func logUserActivity(_ activity: NSUserActivity, label: String = "") { print("\(label) TYPE = \(activity.activityType)") print("\(label) INFO = \(activity.userInfo ?? [:])") }