Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The State of In-app Purchases on Android

The State of In-app Purchases on Android

At the end of the day, what pays the bills is not the amount of RxJava operators you've used, or how cool your Kotlin code looks compared to what you had with Java. What pays the bills is the money you (or the company you work for) earn. As such, join me on a journey that will assess and assert what it means to sell in-app products on Android today, and what it means for the business. We will understand several aspects of their implementation, testing, A/B testing and monitoring, as well as highlighting what we can look forward to in the future.

This talk was presented at Droidcon IT 2018:
http://it.droidcon.com/2018/talks/266/
https://www.youtube.com/watch?v=weDi0HaY9XM

Keynote format: https://drive.google.com/open?id=1o8ubvBz07pNmvTwFcR59qJ0HfuyA_UDC

Sebastiano Gottardo

April 20, 2018
Tweet

More Decks by Sebastiano Gottardo

Other Decks in Technology

Transcript

  1. The State of In-app
    Purchases on Android
    Sebastiano Gottardo

    View full-size slide

  2. “Sometimes all you need
    is a billion dollars”

    View full-size slide

  3. How can we make money
    on Android?

    View full-size slide

  4. In-app products
    Subscriptions
    Managed Products

    View full-size slide

  5. Managed Products
    One-off payments
    Each app can offer different products
    Consumable and non-consumable

    View full-size slide

  6. Subscriptions
    Recurring billing
    Multiple subscriptions (w/ upgrade/downgrade)
    Auto-renewed

    View full-size slide

  7. Subscriptions
    Multiple billing periods
    Recurring payment
    Managed Products
    One-off payment
    Consumable
    Non-consumable
    Non-consumable
    In-app products

    View full-size slide

  8. In-app products
    Product ID (SKU)
    Unique

    View full-size slide

  9. Implementing in-app billing

    View full-size slide

  10. 29 March 2011
    In-app Billing Launched on Android Market
    10 December 2012
    In-App Billing Version 3
    12 June 2017
    New Google Play Billing Library (DP)
    19 September 2017
    Google Play Billing Library 1.0 released

    View full-size slide

  11. In-app billing — High level
    Basic requirement
    an Android device that has billing capabilities
    In-app Billing Service
    IInAppBillingService.aidl
    Libraries

    View full-size slide

  12. In-App Billing Version 3
    isBillingSupported()
    isBillingSupportedExtra…()

    getSkuDetails()
    getBuyIntent()
    consumePurchase()
    getBuyIntentToReplaceSkus()
    getBuyIntentExtraParams()
    getPurchases()
    getPurchaseHistory()

    View full-size slide

  13. ✔ Simple to understand
    ✘ Synchronous!
    ✘ No type-safety
    ✘ Service connection
    In-App Billing Version 3

    View full-size slide

  14. The Play Billing Library (PBL)
    Replaces… nothing
    Maintained by Google
    Offers convenient access to IAB APIs

    View full-size slide

  15. PBL components
    PBL
    BillingClient
    BillingClientStateListener
    PurchasesUpdateListener

    View full-size slide

  16. PBL components
    PBL
    BillingClient
    newBuilder()
    setListener(PurchasesUpdateListener)
    startConnection(ClientStateListener)
    querySkuDetailsAsync(…,listener)
    queryPurchases()
    queryPurchaseHistoryAsync(listener)
    consumeAsync(listener)
    launchBillingFlow()

    View full-size slide

  17. PBL — The good and the meh
    ✔ Less chances of errors
    ✔ Comes with updated samples
    ✔ Proper support for multiple platforms
    ✔ Better (and updated) documentation
    ✘ Not open-source
    ✘ Not really streamlined

    View full-size slide

  18. “I wish this library came
    out 4 months ago”
    Me, June 2017

    View full-size slide

  19. anjlab/
    android-inapp-billing-v3
    Open-source and actively developed
    Good wrapper over bare service calls
    Handling of some edge cases
    A lightweight implementation of Android In-app Billing Version 3

    View full-size slide

  20. in-app billing
    Testing

    View full-size slide

  21. Why testing?

    View full-size slide

  22. Testing in-app products
    Static responses
    Real purchases
    Fake (money, for real) purchases

    View full-size slide

  23. Static responses
    Use reserved product IDs
    Response is automatic
    No need for the app to be on the store

    View full-size slide

  24. Static responses
    android.test.purchased
    android.test.canceled
    android.test.refunded
    android.test.item_unavailable

    View full-size slide

  25. Static responses
    … cannot be used with subscriptions

    View full-size slide

  26. Real purchases
    Require a published app (alpha/beta/prod)
    The real deal, with real money
    Hideous setup

    View full-size slide

  27. Real purchases
    1. Your app is published (i.e., not in draft).
    2. The APK must be published (either production, alpha or beta channels).
    3. The APK you uploaded matches the one you’re testing with when it comes to version code, version name, and keystore
    signature.
    4. When testing on the device, you’re using a different account than the one tied to the Play Console (i.e., not your developer
    account).
    5. The instructions to wait 15 minutes are a bit too optimistic, as it can take up to 2 hours for changes to propagate from the
    Play Console.
    6. Double check that the SKU you’re using in the app matches the one for the product that was configured in the Play Console.
    7. Double check that you’re not trying to purchase an already owned product or an already active subscription.
    8. Double check that you have activated your products in the Play Console: by default, products in the console are deactivated
    and you need to manually activate them.
    9. If you’re using the alpha/beta channels, make sure that the account you’re testing with is part of the testing group (i.e., has
    clicked on “Become a tester” after following the opt-in URL).
    10.If you use ABI flavors, like arm-v7, arm-v8, etc., make sure the APK you’re using for testing contains all the ABI libraries.
    11.Make sure that, when retrieving the Intent using getBuyIntent, you’re passing the correct product type, i.e., inapp if you’re
    purchasing managed in-app products or subs if you’re purchasing subscriptions.
    12.If you’re using the public key for enhanced security, make sure it matches the one on the Play Console because it might
    change over time (see here).
    13.Check that Google Play Services are updated on the test device by going to the Google Play Services page on the Play Store.

    View full-size slide

  28. Real purchases
    http://bit.ly/2EJqoXt

    View full-size slide

  29. Testing setup

    View full-size slide

  30. “Fake” purchases
    License testers
    No money circulates
    Constraints in duration and renewal

    View full-size slide

  31. “Fake” purchases
    Production subscription
    period
    Test subscription renewal
    1 week 5 minutes
    1 month 5 minutes
    3 months 10 minutes
    6 months 15 minutes
    1 year 30 minutes
    Max renewals per sub: 6 times

    View full-size slide

  32. NYT’s Register
    Fake implementation of the billing service
    Configuration via JSON (+ companion app)
    Removes existing limitations
    Allows integration tests to be easily ran

    View full-size slide

  33. NYT’s Register

    View full-size slide

  34. NYT’s Register
    … not yet compatible with PBL !
    PRs welcome "

    View full-size slide

  35. A/B testing price points

    View full-size slide

  36. No platform support
    Android does not offer support for price chances
    If done wrong, it’s disastrous for the user
    Complicated to handle
    … and yet

    View full-size slide

  37. “There is something we
    can do”

    View full-size slide

  38. “There is something we
    can do”
    Me, a few months ago

    View full-size slide

  39. A/B testing infrastructure
    Create multiple products in the console
    Have meaningful product IDs
    Serve products via a custom configuration

    View full-size slide

  40. A/B $$$ - The good and the meh
    ✔ Test different price points
    ✔ Shared configuration across platforms
    ✔ Shared logic (with tests)
    ✔ Flexible
    ✘ (Very) Complicated to achieve
    ✘ Can be abused (country lock, tests within tests)

    View full-size slide

  41. Google Play Console

    View full-size slide

  42. Order management

    View full-size slide

  43. Order management

    View full-size slide

  44. Monitoring subscriptions
    How are your subscriptions performing over time?
    What are your top subscriptions?
    How do you acquire these subscriptions?
    How well do you retain these subscriptions?
    Why did users cancel these subscriptions?

    View full-size slide

  45.  still has the upper hand
    All-around control
    Reliable sandbox environment
    Better promotion tools

    View full-size slide

  46. Subscriptions !
    Promo codes not available
    No easy way of testing
    Discounts only with Web API

    View full-size slide