What is the best way to store product bought anonymous?

Hi! I am creating a app where users don’t need to login. The users are able to buy non-consumable products (products you only have to buy once). Now I need to store the information of when a user has bought a product. For now I am doing that with the SQFlite package, which is working ok. The only thing is that when completely closing the app and restarting it, the database seems to recreate itself. Due to this, the product-buying history is reset and the user has to re-buy the product. Does anyone know what would be the best fix to this? Is it even possible to realize what I am willing with SQFLite?