Repository navigation
Closed
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projecta: tests"flutter test", flutter_test, or one of our tests"flutter test", flutter_test, or one of our testsc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Fluttere: OS-version specificAffects only some versions of the relevant operating systemAffects only some versions of the relevant operating systemp: in_app_purchasePlugin for in-app purchasePlugin for in-app purchasepackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-iosiOS applications specificallyiOS applications specificallyteam-iosOwned by iOS platform teamOwned by iOS platform teamtriaged-iosTriaged by iOS platform teamTriaged by iOS platform team
Description
Use case
I would really like to be able to test In App Purchases with a unit test :) IOS 14 comes with a new Framework to test IAP locally with a storekit file.
See more here, here and here.
Proposal
I would like to be able to use the StoreKitTest class and the SKTestSession in order to mock my in app purchases locally
Could be a good idea to implement it alongside the official In App Purchase plugin for Flutter!
Reacted by Breno Teodoro
Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projecta: tests"flutter test", flutter_test, or one of our tests"flutter test", flutter_test, or one of our testsc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Fluttere: OS-version specificAffects only some versions of the relevant operating systemAffects only some versions of the relevant operating systemp: in_app_purchasePlugin for in-app purchasePlugin for in-app purchasepackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-iosiOS applications specificallyiOS applications specificallyteam-iosOwned by iOS platform teamOwned by iOS platform teamtriaged-iosTriaged by iOS platform teamTriaged by iOS platform team
Activity
Thorbenl commentedon Feb 11, 2021
Is there any update on this @pedromassango ? This is a pretty big deal to why we havent actually launched the app
jmagman commentedon Apr 7, 2021
@Thorbenl see https://github.com/flutter/plugins/tree/master/packages/in_app_purchase/in_app_purchase/example#ios
\cc @mvanbeusekom @cyanglaz can this be closed with flutter-team-archive/plugins#3772?
cyanglaz commentedon Apr 7, 2021
@jmagman Not yet.
@Thorbenl
We have set up StoreKitTest to run the example app on simulator thanks to @mvanbeusekom's flutter-team-archive/plugins#3772
We do want to incorporate
SKTestSessionin our UnitTests in our code base, or even set up XCUITests for our example app.I'm not clear what are you asking here. Did you want the plugin's iOS coded tested with
SKTestSessionso you have more confidence to use the plugin? Or did you want theSKTestSessionto be expose to as a dart API in the plugin?kpradeepkumarreddy commentedon Apr 17, 2021
StoreKit is for testing with the data that is configured locally. How to test with the consumables created on app store connect using simulator ?
mvanbeusekom commentedon Apr 17, 2021
@kpradeepkumarreddy Unfortunately you can't. If you want to test your consumables configured in the AppStore you will have to test on a real device.
LouiseHsu commentedon Mar 25, 2025
This exists now! Please see https://github.com/flutter/packages/blob/main/packages/in_app_purchase/in_app_purchase_storekit/example/shared/RunnerTests/InAppPurchaseStoreKit2PluginTests.swift as an example for how you can use the new testing APIs with StoreKit 2 :)
github-actions commentedon Apr 8, 2025
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.