17.3 Code Setup for Subscriptions
17.3.1 Get IAP Files
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. Paste this folder into the news_app/lib folder.
17.3.2 Configure Subscription IDs
Go to the lib/iAP/iap_config.dart file and add your Product IDs here separated with commas as shown in the picture below.

17.3.3 Enable Subscriptions
After that set the iAPEnaled value to true.

17.3.4 Enable the Disabled Code
Go to the lib/screens/tabs/profile_tab/subscription_tile.dart file and enable all the codes that were disabled.
Go to the lib/utils/next_screen.dart file and enabled the selected line shown in the picture below. Also, enable the package line at the top of this file in the same way.

Go to the lib/screens/tabs/profile_tab/profile_tab.dart file and enable the selected lines shown in the picture below.

That's it. Your subscription setup is completed. Now, you can test the app and the products and publish your app in production by uploading a new version.
Last updated