9 Replies
      Latest reply on Feb 19, 2019 7:46 PM by loopdoc
      The_Unknown Level 1 Level 1 (0 points)

        Hello,

         

        I have massive problems testing the in app purchase in my app. The product is an auto-renewing subscription.

         

        Now I tested the process many times with one sandbox account. After days of testing I now have hundreds of transactions in there. Hence I removed this sandbox account. Now I wanted to test again with a new sandbox user. Of course, I logged out of my real Apple ID on my iPhone in the settings app.

         

        The problem now is that everytime I open the purchase page and restore purchases in my app, the iOS dialog with the old account already prefilled in there pops up. That means, somewhere this reference is stored in my device or even in my apple ID because even if I restart my device or delete and reinstall the app, the email address of my old sandbox apple id is prefilled within the dialog.

         

        Since this is a massive pain for testing, I want to get rid of this information. How can I completely wipe this data?

         

        Thanks in advance.

         

        Bye

        • Re: Clean my device (or apple id?) from old sandbox users and their subscriptions
          PBK Level 7 Level 7 (3,265 points)

          This is called ‘the endless loop’.  You have Transactions in the queue of that device from that test user. You did not call finishedTransactions on those transactions so they will continue to present themselves sometimes daily sometimes weekly until you call finishTransactions. If you deleted the test user you can’t call finishTransactions. Only Apple technical support can delete such transactions.

          • Re: Clean my device (or apple id?) from old sandbox users and their subscriptions
            JCardenetee Level 1 Level 1 (0 points)

            Going to Settings -> iTunes & App Store -> scroll all the way to the botom and you'll see a section called SANDBOX ACCOUNT. The dead user will still be logged in. Log it out. The next time you try to purchase a product, it will prompt you for both an email & password. (iOS 12)

            • Re: Clean my device (or apple id?) from old sandbox users and their subscriptions
              loopdoc Level 1 Level 1 (0 points)

              Even if you can't solve it, you can do a couple things that may help somewhat to keep you making progress.

               

              In the func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) of your PaymentTransactionObserver as you loop over your transactions, first filter and (try to) finish any old transactions.  For example, you could possibly skip transactions before a certain date (though I haven’t needed to filter by date myself).

               

              This could reduce the noise a bit or even a lot depending on your situation.  This is obviously a temporary measure so that you aren't blocked.

               

              The other thing that helps is to put a switch somewhere that allows you to simulate in-app purchases during debug.  For example, I can turn on and off subscriptions manually during debug.  I have a section only present during debug in the table for my settings for things like this.  This may or may not be useful depending on your setup.  Obviously, make sure the switch is not there in the release version.

               

              For me, it has been really helpful to settle a lot of the peripheral stuff around the UI and various other aspects of being subscribed or not.

               

              And I could narrow my focus as I dealt with in-app purchasing issues.