6

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. enter image description here

de3z1e
  • 411
  • 4
  • 8
  • Same result here. I have filed a radar in Feedback Assistant. – Frank R Dec 01 '19 at 10:06
  • I filed a radar as well but haven’t heard back yet. Will update this post when I receive a response. – de3z1e Dec 02 '19 at 14:07
  • No resolution yet on my end.. Any updates? – de3z1e Jan 23 '20 at 23:25
  • No updates here either. – Frank R Jan 26 '20 at 17:56
  • I've noticed that the console gives me an error when I call update(_ userActivity: NSUserActivity) inside my WKInterfaceController. The error reads "sendUserActivityToServer, called on activity 9A440B02-C79F-463F-92E1-AF21C142977A after it had been invalidated, so doing nothing." I'm guessing the NSUserActivity is being invalidated or deallocated automatically somewhere in the lifecycle of the watchOS app. I've even tried setting the NSUserActivity object as a class variable and global variable, but still no luck. – de3z1e Jan 30 '20 at 19:03
  • Thanks for sharing, @de3z1e … have you added this to your bug report? – Frank R Feb 03 '20 at 11:52
  • I do not get this error and I have checked; the WKInterfaceController’s `userActivity` is not being deallocated. I’ve put a breakpoint on a button that I can manually invoke and print the user activity there. It remains in place. – Frank R Feb 03 '20 at 12:14
  • Just wanted to post an update. It appears that Apple has finally resolved the Handoff bug and it is now working as it should between Apple Watch and iPhone for iOS 13.4.1, watchOS 6.2.1, and Xcode 11.4.1. – de3z1e Apr 23 '20 at 21:08
  • Thanks, @de3z1e, I can also confirm that the latest iOS and watchOS releases have fixed the Handoff issues for my app. It seems to work even better than before, but I don’t think that was worth the 6 months of waiting. ;) – Frank R Apr 26 '20 at 15:38

0 Answers0