Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sandbox testing works - sometimes, long delay waiting for switch to sandbox URL #515

Closed
4 of 9 tasks
louiskabo opened this issue Jan 28, 2020 · 2 comments
Closed
4 of 9 tasks
Labels
area: receipt-validation validating receipts for customer or purchase verification duplicate type: bug

Comments

@louiskabo
Copy link

Platform

  • iOS
  • macOS
  • tvOS

In app purchase type

  • Consumable
  • Non-consumable
  • Auto-Renewable Subscription
  • Non-Renewing Subscription

Environment

  • Sandbox
  • Production

Version

ℹ current

Related issues


receipt validation sandbox / production #44
(#44)
iOS 13.2 in app purchase dialog not appearing #501 (#501)
Closure inside SwiftyStoreKit.completeTransactions(atomically: true) { ... } never gets reached #500
(#500)

Report

Issue summary

ℹ Unsure if the cause of my issue is SwiftyStoreKit or not, but it is starting to look that way. Sandbox testing causes phone to partially lock up until reboot. Seems to have trouble switching from production to sandbox URL.

What did you expect to happen

ℹ Sandbox IAP's to complete.

What happened instead

ℹ Device partially locks up until reboot.

It is hard to explain exactly what is happening, but I believe my issues may have something to do with SwiftyStoreKit, through no fault of its own.. I noticed a change somewhere around iOS 13.2/3.

SSK, in sandbox, first tries to send receipts to the apple production server for validation before realizing that its in sandbox and switches over to the sandbox validation URL. Obviously this is by design and used to work quite well. The issue I seem to be having is that when the sandbox version of the app tries to initially verify the receipt with Apple Production, and asks for my live iCloud account password, things lock up. It asks for the password once and then nothing happens. No IAP's, nothing. If I exit the app and try to go to my settings and the "App Store", I can't get in. If I try to download anything from the app store after this, it will just spin and not download. I have to reboot the device in order for it to start working normally again and it usually reboots and pops up a message "Cannot Purchase" after booting. Once I go back into the app to test IAP again this process happens again.

With that being said. I am still able to sandbox test *sometimes. I have to keep trying and rebooting until it allows me to get past the issue and it will eventually ask me for the sandbox user password and then it will make test purchases and work. Very very strange behavior.

I have been racking my brain about it and I really think its on Apple's end, but exacerbated by the "try on production first, fail with 21007 and then go to sandbox".

I have received two rejections thus far from review because I assume they are having similar issues when trying to test.

NOTE: the app IAP's that are currently live work perfectly and quickly in production.

I have taken a few steps to try and mitigate this issue including:

wiping phone and iPad, using a brand new live iCloud account with new sandbox tester accounts. Using new sandbox tester accounts on my main live iCloud account. trying while logged out of iCloud. All of these things seem to result in the same behavior. I can however get it to work eventually by continually trying and using new sandbox tester accounts...

Currently at a loss for what is happening, hoping someone else has seen and figured this out.

Also, to mention, no error messages are being produced, that I can readily see...

Thank you.

@louiskabo
Copy link
Author

I believe my issue described above is caused by what is described in

Apple always rejects app because of in app purchase #397

I will be trying a solution based on that thread and believe that will solve this and therefore make it a duplicate. Followup to come in the near future.

@louiskabo
Copy link
Author

My issues seems to have been solved by following suggestions reference bug report #397

I set a UserDefault to "disallow" checking of receipts until a purchase has been initiated or the user presses "restore purchases". This skips the checking for receipts on first run, which it will find none, as described in that post, or in my case, probably completely overwhelmed by the number of receipts it does find and allows sandbox purchasing to be successful every time.

Closing issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: receipt-validation validating receipts for customer or purchase verification duplicate type: bug
Projects
None yet
Development

No branches or pull requests

2 participants