WillActivate() not called on watch screen turning on

I have an app that is no longer working properly after upgrading to WatchOS 6. Tested this on a Series 3 watch, but many of our customers are complaining as well.


This app has multiple pages, and you can swipe left or right to see other pages. When the screen goes off, then comes back on after raising the wrist, I notice that the WillActivate() function is no longer called. But if I swipe page left or right, the WillActivate() function is correctly called.


Anyone else is seeing this problem? Could it be related to the always-on screen support? Where can I find more documentation on the always-on screen support? Maybe more life cycle events have been introduced? Thanks for the help.

Accepted Reply

I have worked around the bug by using applicationDidBecomeActive. In that I now use dispatch_async to call a method on the interface controller that is also called by willActivate (and contains the code that I previously had in willActivate). I only do this for watchOS 6 and when didDeactivate has not previously been called.


This fixes the issues that I see with watchOS 6 that I do not see with watchOS 5, which confirms that willActivate is no longer being called in watchOS 6.

Replies

I am seeing the same thing. I had a few bugs that could only be explained by willActivate not being called, but I thought that would be impossible (thinking it would be too major a bug to not be spotted?). So I checked and it is indeed not being called on the device. It works fine on the simulator, which makes it even harder to diagnose.


I tried to switch to using didAppear but that seems to not be called either.


I suspect it is related to the always on screen changes, even though it also happens on older watches. That would also explain why such a major bug was not spotted during the watchOS beta as it probably wasn't in that code.

I see that the watchOS 6.1 beta 2 release notes mention this bug fix, that hopefully means that Apple have fixed the problem:


Resolved Issues

View controllers receive the expected lifecycle callbacks. (55457949)

Confirm didAppear() does not work either. Updated to official 6.0.1 today, does not work. Hoping the best for 6.1

One of my users has just reported that it doesn't seem to work on the 6.1 beta 2 either. He's not a developer so cannot confim it, but he is seeing the same effects that are caused by willActivate not being called.


It seems amazing that no-one else has mentioned such a major bug so maybe there is something specific about our apps. What sort of app is yours? Mine is a workout app that also uses Scene Kit to display a vector map.

I have worked around the bug by using applicationDidBecomeActive. In that I now use dispatch_async to call a method on the interface controller that is also called by willActivate (and contains the code that I previously had in willActivate). I only do this for watchOS 6 and when didDeactivate has not previously been called.


This fixes the issues that I see with watchOS 6 that I do not see with watchOS 5, which confirms that willActivate is no longer being called in watchOS 6.

I am amazed why no one else is complaining too. Mine is a golf app, so it is sort of a workout app too. Sad to hear 6.1 is not fixing it yet. The applicationDidBecomeActive fix is really hacky, I am hoping to avoid it, but thanks so much for sharing your approach!

Could well be caused by always on.

Did you try disabling 'always on', to see if it is the cause ?


h ttps://www.howtogeek.com/441346/how-to-disable-the-apple-watch’s-always-on-display/


You could test to implement what you need in didAppear (I hope it's called, could not test yet)

Have you filed a bug report ?

Thanks - I tried both with and without the always on display and it didn't make any difference.


I filed a bug report a month ago and got a reply saying that "didappear and willDisappear are navigation lifecycle events. They're called once when the view is first navigated to or away from". That was it. To be honest I wasn't sure what to make of it. It seemed like they might have been saying that didAppear should no longer be called on wrist raise (which contradicts the documentation), and they didn't even mention willActivate, which is the main problem.


It's not such an issue now that I have worked around it by using applicationDidBecomeActive, but it seems a major bug. However maybe it only affects some apps because it seems strange that only two of us are experiencing it.

Reading the initial post again

When the screen goes off, then comes back on after raising the wrist, I notice that the WillActivate() function is no longer called.


I tried to understand what's happening causing WillActivate() function no longer being called.

There could be some logic here. The change could be due to the always on, even if disabled. I suspect watchOS doesn't call willActivate anymore, because view is already here (when always on in on, but that may now be a general behavior). That is the difference between view being activated (somehow at the top of stack) and screen on showing it (but not activating).

It is also logic that willActivate is called when you swipe, because the view returns to the top (hence activated).

Thanks for the analysis. Did you manage to reproduce the problem?


It happens on watches without the always on display (the OP mentions the series 3) but maybe Apple have changed the logic in watchOS 6 for all watches. I didn't see the problem with the watchOS 6.0 betas though. It seemed to start with the first release version.

No I didn't test on a watch.


I'm waiting a little more to updte to WatchOS 6 to be sure it's fully stable …

Confirm 6.1 still does not fix the problem, so I went ahead and used applicationDidBecomeActive to get around the problem. Thanks so much for suggesting it. Marked it as the correct answer.

We also have the same problem.

willActivate didappear and willDisappear are called once when the app away from foreground. but didAppear should no be called on wrist raise in watch OS6.