Detect if app Widget is removed so I can cleanup cache

I want to detect if widget is removed, so I can cleanup. Currently even though widget is removed, the cache is left out and can rise some privacy/security concerns. Thanks!
Answered by danielbyon.hulu in 658036022
WidgetCenter.getCurrentConfigurations() will fetch all current widgets the user has (and their Intent configurations if applicable), so you can fetch that on app startup and clean things up as necessary
Accepted Answer
WidgetCenter.getCurrentConfigurations() will fetch all current widgets the user has (and their Intent configurations if applicable), so you can fetch that on app startup and clean things up as necessary
Detect if app Widget is removed so I can cleanup cache
 
 
Q