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

27 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.8k
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
778
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
675
Dec ’21
Handoff doesn't work
Hi there, After many research, I come here to find, I hope, a solution. Handoff doesn't work anymore between my MBP and my other devices : When I used some compatible apps on my iPad and iPhone, it appear in the dock on my MBP, but no the opposite, when Messages is open on my MBP, nothing come in the dock on my iPad or on my iPhone. I try a clean install of Monterey, change my apple password, reset the keychain in iCloud, nothing works. If someone had an idea, I will be glad to read it. Regards, Christophe
1
0
951
Nov ’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.8k
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
778
Activity
Feb ’22
Handoff not working on some native apps since beta 12.2
Handoff not working for Pages, Numbers or Keynote. It is working as expected with other native apps such as Safari, Notes, Maps, Contacts etc And I do not have any luck asking this question over in Apple Support Communities run by Apple Support. I am on beta Monterey. SOMEONE HELP ME!!!
Replies
1
Boosts
0
Views
915
Activity
Feb ’22
Handoff not working for same native apps
Handoff not working for Pages, Numbers or Keynote. It is working as expected with other native apps such as Safari, Notes, Maps, Contacts etc
Replies
1
Boosts
0
Views
784
Activity
Feb ’22
Handoff not working for Pages, Numbers or Keynote
Handoff not working for Pages, Numbers or Keynote. It is working as expected with other native apps such as Safari, Notes, Maps, Contacts etc.
Replies
1
Boosts
0
Views
1k
Activity
Jan ’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
675
Activity
Dec ’21
Handoff doesn't work
Hi there, After many research, I come here to find, I hope, a solution. Handoff doesn't work anymore between my MBP and my other devices : When I used some compatible apps on my iPad and iPhone, it appear in the dock on my MBP, but no the opposite, when Messages is open on my MBP, nothing come in the dock on my iPad or on my iPhone. I try a clean install of Monterey, change my apple password, reset the keychain in iCloud, nothing works. If someone had an idea, I will be glad to read it. Regards, Christophe
Replies
1
Boosts
0
Views
951
Activity
Nov ’21