14 Replies
      Latest reply on Jun 14, 2018 3:51 PM by jessica
      jessica Level 1 Level 1 (0 points)

        If a user installed an app from the app store a month ago, then deleted it at some point and reinstalled it, would its receipt's creation date be the day of original install, or the day of a reinstall?

         

        Also, does this behavior change for a sandboxed app?

        • Re: Does an app's receipt creation date get reset after an app delete?
          KMT Level 9 Level 9 (12,235 points)

          Where did they re-install from? icloud? backup? ...?

           

          The receipt is for the original purchase/download. This helps support restoring original purchases. Refreshing the receipt asks the App Store for the latest copy of the receipt/does not create any new transactions.

           

               >Also, does this behavior change for a sandboxed app?

           

          TestFlight apps expire in 30 days, so...

           

          What is it you're trying to do? Flush a sandboxed purchase so you can try anew? If so, it's easiest to just create a new user.

            • Re: Does an app's receipt creation date get reset after an app delete?
              jessica Level 1 Level 1 (0 points)

              Thanks for the response.

               

              It shouldn't matter whey they install from, right? If its from a backup, I would just send a receipt refresh request and get the receipt.

               

              I understand that the receipt is for the original purchase/download. I'm just wondering if the receipt is newly created (new creation date) when the app was deleted off of the phone and reinstalled, even if it does display historical purchase information.

               

              Also, I asked if the behavior changed for a sandboxed app because I can install a debug build over an app store version of the app, so I was curious if the receipt creation date remained the same for the sandboxed app.

               

              What I'm trying to do is check the receipt creation date to see when the user purchased the app, so that I can unlock Pro features for users who had the existing app version. I already looked into checking the CFBundleVersion, but unfortunately the build numbers on versions of the existing app were not consistent so that wouldn't be a great way to check.

                • Re: Does an app's receipt creation date get reset after an app delete?
                  KMT Level 9 Level 9 (12,235 points)

                       >What I'm trying to do is check the receipt creation date to see when the user purchased the app, so that I can unlock Pro features for users who had the existing app version.

                   

                  Ah..info that would have helped earlier

                   

                  And this is about app purchase, then, not IAP?

                   

                  What does a sandboxed app have to do with store bought?

                   

                  Are you trying to grandfather testflight users?

                    • Re: Does an app's receipt creation date get reset after an app delete?
                      jessica Level 1 Level 1 (0 points)

                      This question is about the receipt creation date for an app.

                       

                      I'm asking about Sandboxed app because I need a way to test this. So far in my testing, even if I install a test app over a version of that app that was downloaded from the App Store, the receipt creation date is always the time of when the test app was installed.

                       

                      My hope is that in production, the receipt creation date is the date when the user first ever purchased/downloaded the app from the app store (be it one year ago or two). Even if the user deleted the app on several occasions and reinstalled, I hope the receipt creation date is still the original first time purchased/downloade from the app store date.

                       

                      I don't want to just blindly implement some code for unlocking pro features for upgrading users and hope that it works in the app store. But I don't know if it's possible, since even in Testflight, the creation date is always the current time of when the test app was downloaded.

                    • Re: Does an app's receipt creation date get reset after an app delete?
                      PBK Level 6 Level 6 (2,575 points)

                      This is a well known issue in converting from a paid app to a freemium model and is resolved by using "Original_Application_Version" in the receipt.  Set your Build Number (the value for CFBundleVersion not your Version Number!!!) to something that differentiates it from all previous values of Build Number.  Then inspect the value for Original_Application_Version in the receipt.  If it indicates that the user bought the earlier (or later), paid version (or freemium version) of the app then grant (or not grant) the IAP rights.  It's quite simple.

                       

                      In the sandbox you always get a value of 1.0 for Original_Application_Version.  In the Production  Version, this value will be equal to CFBundleVersion which is your Build Number.

                        • Re: Does an app's receipt creation date get reset after an app delete?
                          jessica Level 1 Level 1 (0 points)

                          This is another solution to go by, which I am aware of.

                           

                          I was looking for a solution with the receipt creation date as well, because again I do not feel comfortable assuming that using the original application version number in the receipt in the production build will work to validate if the user is upgrading or a new user. I'd feel more comfortable if I would actually be able to test this.

                           

                          A solution I'm going to try is to do a point release with the current app release, and add code there to NSLog the receipt creation date and original application version (also found in the receipt). Once I can download that point release from the app store and inspect the logs and see if the data logged meets up with my assumptions, I can be more confident using those values to determine upgrading or new users.

                    • Re: Does an app's receipt creation date get reset after an app delete?
                      PBK Level 6 Level 6 (2,575 points)

                      A receipt is created when there is a purchase or when there is a receipt refresh.  I would not expect a new receipt for a reinstall but I could be wrong.  I could be wrong especially because a receipt is signed with the device's identifierForVendor which can change from one reinstall to another reinstall. 

                       

                      Regrading the sandbox - I believe you get a new receipt each time you reinstall from XCode because each such reinstall is a 'purchase' of the app. 

                      • Re: Does an app's receipt creation date get reset after an app delete?
                        jessica Level 1 Level 1 (0 points)

                        Yes, the app's receipt creation date gets reset after an app delete (this is for apps without auto-renewal subscriptions)

                         

                        I tested this by NSLogging the receipt creation date and testing with an app downloaded from the app store.