[MacCatalyst] Unavailable to clear data during uninstallation or to reset it during first launch after reinstallation

Hello!

We want to port our iOS application to macOS as Catalyst app and to distribute it via App Store. But we have a problem with storing facts of user agreement acceptance. To be precise we need to reset agreement facts and show the agreements again every time a user reinstalls our app. These facts are stored in the directory ~/Library/Group\ Containers/group.com.bundleid

It isn't a problem for our iOS app because it removes all app data during uninstallation, but macOS doesn't, so the agreement facts remain on the Mac. Since we have no control under uninstallation process and we can't create and distribute our own uninstaller, I found a way to check bundle's creationDate or modificationDate and reset the agreement facts if it changes. But it seems like both of the dates also change after the application update, so we can't differentiate an update from reinstallation this way.

So the question is whether there is a way to reset these data during Mac Catalyst application uninstallation or to differentiate a reinstallation from an update?

Just like any other Mac app, there is not a way to reliably detect app removal, as what counts as “removal” is not as clear-cut as it is on iOS. The user could have copied your .app bundle to another location, for example, and deleted the first one. On a Mac, the user’s data is never removed when the user deletes your app.

[MacCatalyst] Unavailable to clear data during uninstallation or to reset it during first launch after reinstallation
 
 
Q