Is there a way to know when widget is installed/uninstalled?

Hello,
For tracking purpose, is there a way to know when a widget is installed/uninstalled?

Also, would it be possible to check which size widget was installed?
When widget is added to home screen, that is the time when Provider.timeline method gets called. In other cases for display higlight, its just Provider.snapshot method which gets called.
@dev.rockstar - Thank you!, but timeline gets called every time the widget needs to be updated right?
Also, is there a method which gets called when widget is uninstalled?
I don't know if you can get exactly what you are looking for, but I think you can achieve the same end results using getcurrentconfigurations(_:). It will allow you to query what widget configurations are currently in use from the main application. This should allow you to periodically poll for the current widgets and then record whatever you need.

https://developer.apple.com/documentation/widgetkit/widgetcenter/getcurrentconfigurations(_:)
@jcgoforth, thanks a bunch!, i am able to get the widget info if the widget was installed.
However, when i uninstall the widget, i still get the widget info in the response to above method.

Do you know if there is a different method that i need to invoke in order to check if the widget was uninstalled?
Also, I tried adding small, medium widgets, and i see the family as invalid in the getCurrentConfigurations response.[0]

Code Block
[0] WidgetInfo
configuration INIntent? nil none
family WidgetFamily <invalid> (0x0)
kind String "SomeWidget"
[1] WidgetInfo
configuration INIntent? nil none
family WidgetFamily <invalid> (0x1)
kind String "SomeWidget"


I haven't tried to use the API myself, but what you are seeing feels like a bug to me. I am certainly not from Apple so I don't know what they expect, but I would expect it to give you up-to-date information about all the currently active widgets along with a valid family type. If you aren't seeing that I would recommend submitting feedback and hope it gets addressed before the release.
Thanks you @jcgoforth.
Where can we submit the feedback?
I am also looking for such API and asked similar question on SO Any official response would be great here :)
@parimi1107
Having the response like the following getCurrentConfigurations response will not help you, since if Apple decide to put your widget on the Gallery widget then it will show as it was installed which is false.
Apple doesn't support this kind of status unfortunately, you will never know if the widget was installed or not since Apple also may call the timeline before editing the widget (I've log it to file and I saw they might call timeline).
Is there a way to know when widget is installed/uninstalled?
 
 
Q