I am building a Flutter app with In-App Purchases implemented using the in_app_purchase
plugin (or in_app_purchase_storekit
on iOS). After a successful purchase on iOS, the system automatically shows the native Apple confirmation popup that says something like “Your purchase was successful”.
I want to know:
in_app_purchase
plugin docs but didn’t find any options to disable the popup.Any guidance or best practices on how to handle or work around this default iOS purchase confirmation popup in Flutter would be very appreciated.
Thanks!
Is there a way to suppress or disable this default Apple confirmation popup within a Flutter app?
No.
Can I fully replace it with a custom Flutter animation or UI instead?
No.
Or is this popup mandatory and unavoidable for compliance reasons?
I don't know what "for compliance reasons" means. You cannot prevent the confirmation alert. You cannot modify the confirmation alert. You cannot even detect the confirmation alert. It is all happening outside of your app.
For a long time, I did try, in my apps, to supplement the confirmation alert, that is, to wait until it had appeared and had been dismissed, and then to present my own alert. (See https://stackoverflow.com/a/55342219/341994.) But I no longer even do that, because it just isn't worth the trouble: the attempt relied almost entirely on guesswork, and that's no way to program.
Instead, you should do what Apple wants you to do — namely, when you are notified that the user has completed the purchase, you should modify the overall interface of your app in a way that reflects that the user can now experience the app in a different way. For instance, you might change the title of an already visible button, or the text of some already visible label, in accordance with the fact that this item is now purchased. Apple's purchase and confirmation interface will appear and vanish, leaving your altered interface visible — and that's that.