Depending on where you deploy your package, you might have options for that.
Like google play offers options to retrieve previous purchased items.
amazon has something similair.
They will store the users identity tied to their device/store account details.
To store it yourself, you could resort to storing in webstorage.
Or passing information to a sepperate database through use of Ajax posts. For instance, PHP mysql.