Posts

Post not yet marked as solved
0 Replies
644 Views
Since updating to iOS 13 and watchOS 6, I am unable to get the Handoff feature working from Apple Watch to iPhone for any apps that I build. The feature was previously working on my existing custom built apps, but is no longer working since the OS updates. I can confirm that Apple's native apps which support Handoff on Apple Watch and iPhone are working correctly, so I'm ruling out any iCloud login/account issues. To help troubleshoot and isolate the issue, I ended up building a demo iOS and watchOS app to test the Handoff feature. I made sure to include the user activity in the iOS app's info.plist under NSUserActivityTypes and I'm using the same developer team ID. I'm also using the latest Xcode version 11.2.1. The Handoff icon should be appearing in the App Switcher on my iPhone when the WKInterfaceController below is visible, however it is not showing up. Am I missing something since the updates? Thanks.Here is my WatchKit code.import WatchKit import Foundation class InterfaceController: WKInterfaceController { var userActivity: NSUserActivity? override func awake(withContext context: Any?) { super.awake(withContext: context) // Configure interface objects here. userActivity = NSUserActivity(activityType: "HandoffDemo.Handoff") userActivity?.title = "Activate Handoff" userActivity?.isEligibleForHandoff = true userActivity?.userInfo = ["key":"Hello"] userActivity?.requiredUserInfoKeys = ["key"] userActivity?.becomeCurrent() } override func willActivate() { // This method is called when watch view controller is about to be visible to user super.willActivate() update(userActivity!) } override func didDeactivate() { // This method is called when watch view controller is no longer visible super.didDeactivate() } }Info.plist on the iOS app.
Posted
by DimitryZ.
Last updated
.