3

I am trying to use handoff to make an iphone app do something when the user does something in the watchkit app. In the watch app (in InterfaceController.swift), I have this code that gets run when the user taps a button:

self.updateUserActivity("com.test", userInfo: ["one":"two"], webpageURL: nil)

Then in the AppDelegate.swift file of the phone app, I have this code:

    func application(application: UIApplication!,
        continueUserActivity userActivity: NSUserActivity!,
        restorationHandler: (([AnyObject]!) -> Void)!)
          -> Bool {

      let userInfo = userActivity.userInfo
      println("testing: \(userInfo)")
      return true
    }

In theory this should print the userInfo (in this case ["one":"two"]) to the console, but I think I'm missing something here.

GoZoner
  • 67,920
  • 20
  • 95
  • 145
ZhouW
  • 1,187
  • 3
  • 16
  • 39

0 Answers0