Search code examples
iosin-app-purchase

Apple In App Payments: Sandbox user issue


Edit: FYI anyone using https://pub.dev/packages/flutter_inapp_purchase should use the official https://pub.dev/packages/in_app_purchase

I am trying to implement In-App Payments (IAP) in my Flutter app. I'm using this library, but the documentation is all over the place and I'm not really sure on the flow. I have made some progress, but after I cleared my sandbox user's purchases, the receipts weren't able to be processed anymore (vague error code: 21005).

What I did was remove the old user from App Store connect, and make a new user, darajavaherian+test1@gmail.com. I signed out of my iPhone and signed in with ...+test1@gmail.com, as well as signed in to the App Store with it, but my app still tries to make the payment with ...+test@gmail.com.

So I am wondering firstly how to use my new sandbox tester be used with the app, but more importantly, am wondering what user apple uses to charge the user? It's not related to user accounts on my app. It doesn't seem to be related to user accounts on the iPhone or on the App Store.

I have signed in with the new user to both app store and ios, deleted the app, restarted my phone, rebuilt with flutter and the issue still persists.

enter image description here


Solution

  • Solved it!

    Settings > App Store > Sandbox Tester

    I don't really understand why, but my old tester was saved in there.