Effective use of .disfavouredLocations API

I have a Health & Fitness widget that runs on iPhone and Apple Watch. As Health data access requires the device to be unlocked, the iPhone widget is already slightly limited in capability because of updates.

With widgets further expanding to places like CarPlay, I know I can use the .disfavouredLocations{} API to try and prevent it being offered there. This is crucial as the widget functionality would be basically non-existent as your device is locked during CarPlay use.

My problem is, on the Mac despite using the .disfavouredLocations{.iPhoneWidgetsOnMac} etc...., the widget can still be added in the "other unsupported section". And yet, in that section the Apple Fitness app widget is no where to be seen. Is there an API I am missing to completely remove a widget from the Mac widget gallery and hopefully CarPlay, Standby etc.... (all places where the device running the widget is usually locked -> No Health data)?

Or does the Apple Fitness app have a private API to block it from these places where its function is not wanted and this isn't available to other apps?

Hello simonfromhelix!

Out of curiosity what Data Protection level are you using for extensions? If you mark your extension as NSFileProtectionCompleteUntilFirstUserAuthentication or NSFileProtectionNone a remote widget on iOS will not be available as remote widget on macOS.

https://developer.apple.com/documentation/widgetkit/creating-a-widget-extension/#Hide-sensitive-content

Effective use of .disfavouredLocations API
 
 
Q