17.3 Code Setup for IAP
Make sure you have completed all of the previous steps of 17, 17.1 & 17.2.
You will get an iap.zip file from us in your email after contacting us with your purchase code. Unzip it and you will get a folder named IAP. Copy this folder and paste this folder into the quiz_app/lib folder.
Open the app source code in your IDE and open the lib/IAP/iap_config.dart file.
Now add your IAP Product IDs here separated with commas as shown in the picture below.
Now go to the lib/tabs/home_tab.dart file and enable the selected disabled lines shown in the picture below.
That's it. Your IAP setup is completed. Now, you can test the app and the IAP products and publish your app in production by uploading a new version.
To test the In-App Purchases feature, use a real Android or iOS phone. Emulator/Simulator doesn't support this.
Last modified 15d ago