Delete files from system.DocumentsDirectory while uninstalling

I want to delete a file from system’s DocumentsDirectory automatically while the app will be uninstalled. I got the lfs and os.remove to remove the file. But how to trigger that during uninstallation ?

I didn’t think you needed to.  AFAIK removing the app also removes the contents in documents.

All sandboxed data (for your app) is removed when you uninstall.

I didn’t think you needed to.  AFAIK removing the app also removes the contents in documents.

All sandboxed data (for your app) is removed when you uninstall.