5

I have added logs on both WKExtensionDelegate and WKInterfaceController. Here is what i get when playing around with starting and exiting the app in Watch OS Simulator. (Simulator is running watchOS 4.2)

Step 1: Upon first start of the app here are the logs i see:

  • Init ExtensionDelegate
  • applicationDidFinishLaunching
  • applicationDidBecomeActive
  • awake withContext
  • willActivate
  • didAppear

Step 2: While I am in-app, after pressing home button (Cmd-Shift-h), I geth the following logs:

  • applicationWillResignActive
  • didDeactivate
  • willActivate
  • didAppear
  • didDeactivate

Step 3: I start my app again from app screen (the same goes when starting it from a complication)

  • applicationDidBecomeActive
  • willActivate

Question 1: in Step 2, didDeactivate is called 2 times, also willActivate and didAppear are called for some reason. I would expect just didDeactivate to be called one time. Has anyone got the answer for why this happens?

Question 2: in Step 3, after willActivate i would expect didAppear to be called. Why is it not called?

Dusan.czh
  • 669
  • 8
  • 15
  • I have also been wondering why when I press in the crown to send my app to the background I get the following order in my interface controller: didDeactivate, willActivate, didAppear, didDeactivate, willDisappear. I've been trying for the longest time to figure out why it activates and appears after going into the background. – Jackson Jan 22 '19 at 03:01
  • Please note that app lifecycle is skewed if app is run in debug mode through xcode. I'd suggest to install app on a real device and launch it without any debug session attached. – average Joe Apr 04 '19 at 10:20

1 Answers1

-1

I am experiencing the same behaviour on both the simulator and the Apple Watch. I have no idea what is the problem there (bad documentation or bugs in the SDK) but from my experience it is much better (and time saving) to try workaround the issues for such weird cases instead of trying to figure out what is wrong with the SDK.

plamkata__
  • 729
  • 5
  • 13