I am developing an app that gives access to a certain database for information lookup.
The idea is to charge $2.99 for the app in the app store which gives access to the current version of the database for life.
Then, whenever a new version of the database is available (happens annually), offer a non-consumable in-app purchase to get lifetime access to the new version.
My problem
If a user buys the app in 2022 and uninstalls it when the in-app offer to upgrade to 2023 comes up (not purchasing the upgrade) and then reinstalls it, How can I figure out what version of the database they are entitled to?
How can I determine when they first bought the app?