WKInterfaceController.openParentApplication is delayed on real device?

I have been tracking this error for several days and finally realized that there was a latency issue WKInterfaceController.openParentApplication

. I don't mean the callback on the Apple Watch, but the event AppDelegate

on the iPhone.

Here's what I do on Apple Watch:

override func awakeWithContext(context: AnyObject?) {
  var userInfo = [
    "test": 123
  ]

  WKInterfaceController.openParentApplication(userInfo, reply: nil)
}

      

Then on the iPhone, I do this in AppDelegate

:

func application(application: UIApplication, handleWatchKitExtensionRequest userInfo: [NSObject : AnyObject]?, reply: (([NSObject : AnyObject]!) -> Void)!) {
  let test = userInfo["test"]
  // Do something
}

      

The problem is when I call WKInterfaceController.openParentApplication

, there is a delay of 2 or 3 seconds before the event is handleWatchKitExtensionRequest

triggered on the iPhone. This is problematic if the user quickly performs an action on their watch and immediately puts their hand down. I can't imagine the user will hold their hand for 3 seconds until the watch sends a command.

Here's the catch: if the user wakes up the watch, the command still isn't sent to the iPhone. OPTIONAL the user opens the original application that sent WKInterfaceController.openParentApplication

. I don't think it could be a problem without this catch, the team should be queued until the clock is awakened and not awakened. And run the application again.

Any workaround that can be done for this? I plan on logging this as a bug, but wanted to see if anyone has any thoughts or experiences?

+3


source to share





All Articles