Thank you for choosing my video, enjoy watching the simplest way to implement an in-app purchases subscription.
Source code: https://sharcourse.co.za/in-app-subsc...
Pre-requisite
Google Play Console Account
Published App on Play Store
Tester Device with GMS
Configure Your Testing device by adding the Gmail account to internal testing testers and License testing.
Setup the in-app purchase products in the Google Play Console account
I have already created mine which are
Product ID: sub_premium
The following methods (These are the methods you need for the IAP System to work, you can copy and paste)
void establishConnection(){}
void showProducts(){}
void launchPurchaseFlow(){}
void verifySubPayment(Purchase purchases){}
void checkSubscription(){}
Step 0: //Add the Google Play Billing Library dependency
Step 1: //Initialize a BillingClient with PurchasesUpdatedListener
Step 2: //Establish a connection to Google Play
Step 3: //Show products available to buy
Step 4: //Launch the purchase flow
Step 5: //Processing purchases / Verify Payment
Step 6: //Handling pending transactions
Step 7: //Check the subscriptions on SplashScreenActivity