In-App purchase transaction fails with SKErrorPaymentCancelled in sandbox mode

StackOverflow https://stackoverflow.com/questions/20856452

  •  23-09-2022
  •  | 
  •  

Вопрос

Context

  • Products load correctly via SKProductRequest
  • Test users setup via itunes connect and verified
  • Logged out from my "normal user" account on the device
  • Logged in as test user on the device

Problem

  • The payment transaction fails with SKErrorPaymentCancelled without any action from the user
  • The app is redirected to the iTunes Store and keeps asking for the user credentials
Это было полезно?

Решение

The problem is that I was logging the test user by using the Settings --> iTunes & App Store --> Apple ID.

This process seems to "convert" the test user into a "real user". In fact, you get asked for credit card info and such, as would be expected for a "real user".

The solution is:

  • create a new test user
  • ensure that no user is logged in the Settings --> iTunes & App Store --> Apple ID
  • test the purchase path in your app
  • when asked for user credentials, use the newly created user credentials

I hope this saves you time.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top