0

I try to keep track of inapp purchases (both ios and android) of users. I want users to use the app without creating an account so I tried using the deviceID but that changes after reinstalls. Same with revenuecats ID

How can I keep track of purchases? Whenever I reinstall the app in e.g. Testflight the purchases are gone. How can I recognize and link them to the users google/apple account or some sort of fixed ID?

  • Are these consumable or non consumable purchases? – Paulw11 Jul 30 '22 at 09:04
  • @Paulw11 Consumable Purchases – heleloper Jul 30 '22 at 09:54
  • Then you really need your users to create an account so that you can store their purchases. You can make the account creation optional and explain the benefits of creating an account. You can store their purchase details in the keychain on ios which will protect against people deleting and then reinstalling the app (a pretty unlikely scenario) but an account will let them keep purchases when they change devices. – Paulw11 Jul 30 '22 at 10:30
  • Please provide enough code so others can better understand or reproduce the problem. – Community Jul 30 '22 at 13:00
  • @Paulw11 But arent there other apps (I think of games) where you dont lose consumable things after e.g. updates? There you dont have to create an account – heleloper Jul 30 '22 at 15:16
  • You don't lose any data have an update where the app is already installed. An update simply replaces the binary, not the data that is stored. You are talking about reinstalls in your question. That is a delete->reinstall in my mind. What exactly are you doing when you lose data? How are you storing their purchase balance? – Paulw11 Jul 30 '22 at 21:38
  • @Paulw11 I implemented purchases with revenue cat. They have a 'restore' function and I only use that. Is it generally to be expected that purchases are gone after a reinstall? That way you would have to make your users create accounts to keep track. Also a different device for the same user would also mean that the purchases are gone since you cant access google/apple account data to link to that – heleloper Jul 31 '22 at 05:20
  • As I said, a true re-install on a single device is typically rare. Storing an id in the keychain can help with this on iOS. There is probably some equivalent on Android. Moving between devices or even having the app installed on multiple devices concurrently (an iPhone and an iPad for example) is much more common. Apple requires that creating an account *is not compulsory* but you can suggest that your users do so and explain the benefits (you won't lose your purchases when you move between devices) – Paulw11 Jul 31 '22 at 07:28
  • @Paulw11 Alright, thank you! But this seems to be the same problem for subscriptions or why did you ask "consumable or non consumable"? Anyway, thank you a lot! – heleloper Aug 01 '22 at 11:22
  • Auto renewing subscriptions and non-consumable purchases are restorable. Apple tracks the purchase and you can trigger a restoration to receive the purchase transaction again. Non renewing subscriptions and consumable purchases need to be managed by you. – Paulw11 Aug 01 '22 at 13:34

0 Answers0