9 Replies
      Latest reply on Nov 27, 2019 11:45 AM by PBK
      raybirk Level 1 Level 1 (0 points)

        After the following steps:

        1. User logs in to iTunes account
        2. User logs in to my app
        3. User purchases subscription through IAP
        4. User logs in with different iTunes account

         

        If I change the subscription through IAP after these steps, I would get an error. That is fine but I have 2 questions:

        1. How does it know the account has been changed? Is it because the receipt of the new purchase does not agree with the previous receipt?
        2. I would like to prevent the error by blocking users from changing subscription plans if a different account is used. How can I know that a different account is used?

        Thanks in advance.

        • Re: Subscriptions and iTunes account change
          KMT Level 9 Level 9 (15,215 points)

          What error?

           

          Is this the "Current receipt invalid or mismatched ds person id" error?

           

          If you're asking about dealing with fraud, see the IAP FAQ What can I do to help combat fraud during purchase transactions?

            • Re: Subscriptions and iTunes account change
              raybirk Level 1 Level 1 (0 points)

              I'll need to find the error later as I can't change subscriptions in development with sandbox.

               

              The main concern is not fraud but to prevent accidentally using the wrong iTunes account. With the same account, users can upgrade/downgrade subscriptions. But with a different account, they may accidentally purchase a separate subscription (if it actually works), or get an error.

                • Re: Subscriptions and iTunes account change
                  KMT Level 9 Level 9 (15,215 points)

                  Not sure the you can/it's your job to shield users from conflating iTunes accounts. If they make a mistake/end up with an unattended purchase, they can contact Apple and plead their case, but I wouldn't expect Apple to give them too many chances to be more careful.

                   

                  Otherwise, it's hard to imagine a receipt not 'agreeing' with a given purchase that doesn't involve an all out snafu on the backend, etc.. A user can only be in one purchase space at a time, ifs not withstanding.

                   

                  Is there a repeatable example in the wild you've experienced that prompts your concern, or is this just some hypothetical that popped up during an app planning session, or...?

              • Re: Subscriptions and iTunes account change
                PBK Level 7 Level 7 (3,345 points)

                When the user changes their iTunes account they are a 'different' user.  The different user did not make the original purchase (of the IAP or the app) and therefore can't change their subscription (or restore their IAPs).   This inability prevents a user from purchasing a non-consumable IAP and going from device to device (of all their friends), logging into their iTunes Account, restoring the purchase and then logging out of their iTunes Account. 

                 

                • How does it know the account has been changed? Is it because the receipt of the new purchase does not agree with the previous receipt?

                 

                    It is because StoreKit has access to the iTunes Apple ID of the user and recognizes that it is different.

                 

                • I would like to prevent the error by blocking users from changing subscription plans if a different account is used. How can I know that a different account is used?

                 

                    I don't think you can.  That is Apple's information and I think you can't get it from the system.  But the user usually knows exactly what is causing the problem.  A user changes their iTunes ID only because they are trying to 'share' their purchase. 

                • Re: Subscriptions and iTunes account change
                  raybirk Level 1 Level 1 (0 points)

                  Thanks KMT and PBK. This is given as an requirement to prevent confusions. I guess we're not so strict on running on multiple devices.

                   

                  If I keep the current receipt on a server, can I check by comparing with the receipt I get from current iTunes user?

                    • Re: Subscriptions and iTunes account change
                      KMT Level 9 Level 9 (15,215 points)

                          > can I check by comparing with

                       

                      You can try....whether or not there is an actionable path is another issue. Personally, I think that 'requirement' more about chasing ghosts, with a splash of paranoia tossed in for flavor, but, hey, your team is allowed to learn, same as the rest of us

                       

                      See the IAP FAQ: Receipt

                      • Re: Subscriptions and iTunes account change
                        PBK Level 7 Level 7 (3,345 points)

                        >If I keep the current receipt on a server, can I check by comparing with the receipt I get from current iTunes user?

                         

                        I cannot understand what you are asking.  Please try to be more precise.  What current receipt; check what; what current iTunes user?

                         

                        Different iTunes Accounts are different users.  Issue an error message; the user knows exactly what they are doing when they change iTunes Account.