complicationEnabled in watch app

I know that we can use complicationEnabled in the WatchConnectivity to let iPhone App knows if the complication is installed or not.

but how can I let the watch app know the complication enabled or not? it seems it does not have the complicationEnabled property in the WCSession in the watch device side.


Thanks

Accepted Reply

Perhaps I'm misunderstanding what you are trying to determine, but wouldn't

BOOL hasActiveComplication = [[[CLKComplicationServer sharedInstance] activeComplications] count] > 0;

answer the question?

Replies

I think it's not possible.

Your extension delegate is shared between watch app and complications, so you could track when you are doing complication updates and save that status for when the watch app wakes up.

You're right!

I forgot extension delegate 😢

This is easy to check when the complication is installed.

but if the complication is uninstalled, the delegate is not easy to know it is not updated or uninstalled.

Why do you think it would be hard?


The complication will update as soon as it is enabled, so I would set a status that is false until the complication updates. The only challenge is when the complication is removed. You may want to use a time of last update and check if an update has occurred recently to tell when the complication is removed.

Yes, what I said is check the complication removed or not is hard.

use a timer of update to check may be not correct (not update does not mean it is removed), and most importantly, it has at least several minutes to hours delay, not instantly

Perhaps I'm misunderstanding what you are trying to determine, but wouldn't

BOOL hasActiveComplication = [[[CLKComplicationServer sharedInstance] activeComplications] count] > 0;

answer the question?

Thanks