Allow users to start an activity on one device and seamlessly resume the activity on another device running iOS, iPadOS, or macOS using Handoff.

Posts under Handoff tag

26 Posts

Post

Replies

Boosts

Views

Activity

onContinueUserActivity not Called with Handoff & SwiftUI
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? 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 ?? [:])") }
1
0
1.9k
Mar ’22
Universal Control not working at all!!
i updated my iPad Pro 2018 to the latest 15.4 beta 2 and my M1 Macbook pro to 12.3 beta 2 but still i can’t get univesal control to work on my devices both of them have the same icloud account wifi and bluetooth enabled on both both are on the same wifi network handoff enabled on both univesal control setting (allow mouse ….) enabled on both i really need it, please help
0
0
854
Feb ’22
iOS Development opening a Safari page on Mac
Hi, I'm just wondering if there is a way to open a safari page from the iOS app I am developing with Swift. The link property could be used in this scenario but I want to emphasize that the page must be open on macOS. So basically what I want is like the handoff feature of Apple but mixed with the link property. Maybe I could open a page using link structure but kinda not display it? Is there any workaround you can think of?
0
0
752
Dec ’21
onContinueUserActivity not Called with Handoff & SwiftUI
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? 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 ?? [:])") }
Replies
1
Boosts
0
Views
1.9k
Activity
Mar ’22
Universal Control not working at all!!
i updated my iPad Pro 2018 to the latest 15.4 beta 2 and my M1 Macbook pro to 12.3 beta 2 but still i can’t get univesal control to work on my devices both of them have the same icloud account wifi and bluetooth enabled on both both are on the same wifi network handoff enabled on both univesal control setting (allow mouse ….) enabled on both i really need it, please help
Replies
0
Boosts
0
Views
854
Activity
Feb ’22
iOS Development opening a Safari page on Mac
Hi, I'm just wondering if there is a way to open a safari page from the iOS app I am developing with Swift. The link property could be used in this scenario but I want to emphasize that the page must be open on macOS. So basically what I want is like the handoff feature of Apple but mixed with the link property. Maybe I could open a page using link structure but kinda not display it? Is there any workaround you can think of?
Replies
0
Boosts
0
Views
752
Activity
Dec ’21