title: Maintaining records of iOS in-app-purchases
body: <p>I've implemented IAPs where there's a one time purchase that unlocks some feature in the app. Since the purchase is made only once by each user I can just ask Apple's IAP service if this user has the made the purchase. If so then unlock the feature. If not then display the IAP prompt. I probably also persisted some "userDidMakePurchase" flag in user defaults as an imperfect solution to using the app w/o a network connection.</p>
  
  <p>Now I'd like to implement an IAP where the user can make it over and over. Each time the user is given ten tokens to use an in-app currency. <strong>How can I determine the number of tokens a particular user has when they start the app?</strong></p>
  
  <p>So far I've considered persisting a token count in user defaults. This has some major downsides like deleting and reinstalling the app wipes out the user's token balance. Also tokens won't carry over to other devices.</p>
  
  <p>Of course I could persist the token counts on my own server or use AWS. However I'd like to avoid this if possible. I'm only familiar with IAP basics so perhaps Apple keeps track of all purchases and I can just figure it out from there.</p>