0

I am working on an application for watchOS that needs support from watchOS 7.0 to the last version, in terms of the app itself its going well, but I'm having problems with the complications, I have two sets of working complications, one made with WidgetKit and one with ClockKit, but as they work entirely differently I'm having some trouble connecting the two of them, I want my ClockKit complications to show when the watchOS versions in below 9 and the WidgetKit Complications to show when the watchOS version in 9 or above.

Right now I have three targets that are relevant, a watch target, a watch extension target and a different target for the Complications, because as far as I know you can only set the entry point for the WidgetKit Complications using @main and you can only have one @main per target, so I couldn't have it in the watch extension target in which the rest of my app is, even the ClockKit Complications, as they can be set in the target>Complications Configuration options

In the Info.plist file of my WidgetKit complications target I have the following:

enter image description here

On the NSExtensionPointIdentifier field I change between two values:

com.apple.widgetkit-extension : Whenever I have this value, the app and complications will work fine on watchOS 9+, showing my WidgetKit Complications, however it wouldn't launch on watchOS 9-, saying that "Could not install at this time ... ios.aplicacion.tiempo-com.watchkitapp.watchkitextension.CompliWatchExt specifies a value (com.apple.widgetkit-extension) for the NSExtensionPointIdentifier key in the NSExtension dictionary in its Info.plist that does not correspond to a known extension point." So it doesn't recognize the widgetkit-extension identifier.

com.apple.services : Although I feel this is just any non "widgetkit-extension", because this basically gets rid of the WidgetKit Complications, making it work on any version but only having the ClockKit Complications.

So basically what I want is the app to work as if it had com.apple.widgetkit-extension on watchOS 9+ but to work as it had com.apple.services on watchOS 9-, is there any way to get this result?

1 Answers1

1

Okey I found the solution although it's not really a solution, It was just a misconception from my part, the only thing I needed to do was set the Deployment target to 9.0 in the target I had the Widget Complications in, as Xcode gives preference to the widget kit complications when both are available

  • Does this mean that you preserved the old (ie, 9-) watch target in the app (to be used by 9- users)? I thought we cannot have the old watch target and the new target – RawMean Jul 17 '23 at 19:06
  • 1
    In terms of app itself I only have a watch and a watch extension target (It's all I needed to support from watchOS 7 to last version), I have another target which is used only for the WidgetKit complications, as the entry point is with @ main, the same as the app, I couldn't find a way to have two @ main entry points (even with different purposes), but the entry point for ClockKit complications can be set in the configuration of the watch extension target, so I have 2 global targets and 1 target only for WidgetKit (9+) complications, I feel I probably overlooked something, but it works so far – pedromolina779 Jul 19 '23 at 08:52
  • I need to migrate the main watch app also to watchOS 10 (not just the widgets). I guess it's not possible to keep both targets for the watch app around (the old one for 10- and the new one for 10+). Reason for migrating to watchOS 10: I want to the new watchWidget AND I want to add interactive complications. – RawMean Jul 19 '23 at 18:48