Learn how to launch the purchase flow for subscription purchases.
- [Instructor] Now, let's go ahead and add in the code…for launchIapSubscription method.…Let's first go to launchIapPurchase,…and I'm going to copy the name of the method,…and paste it to the beginning of our error string.…This way, we will know whether the error is coming from…IapPurchase or IapSubscription.…Now, we also want to turn on our progress indicator,…so let's go to line 131, and call listener.onProgress,…and set it to true.…
Now let's copy the whole block,…and paste it into launchIapSubscription.…Instead of skuProductCrop,…we're going to pass in skuSubscriptionMonthly.…Instead of productSkuPrice,…we're going to pass in subscriptionSkuPrice.…And instead of BillingClient.SkuType.INAPP,…we're going to pass in SkuType.SUBS.…Now let's modify the error string.…We'll copy the name of the method on line 144,…and replace it in line 149,…and instead of product, we'll call it subscription SKU.…
Now let's do a Gradle sync,…and then a clean.…And there are no build errors.…Now we're ready for the next step.…
- Setting up an existing app for In-app Billing
- Working with the Gradle build system
- Registering a keystore
- Defining and accessing Gradle build configuration parameters from code
- Setting up a payments merchant account
- Setting up IAB test accounts
- Publishing the APK to Google Play alpha
- Defining managed products and subscription products
- Implementing In-app Billing
- Testing in-app purchases
Skill Level Intermediate
Q: This course was updated on 07/20/2018. What changed?
A: The following topics were updated: UI setup for in-app billing, adding public key, publishing your APK to Google Play alpha, and implementing in-app billing.
1. UI Setup for In-App Billing
2. Understanding the Gradle Build System
3. Setting Up for In-App Billing
4. Defining In-App Products
5. Implement In-App Billing
Next steps1m 40s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.