Search code examples
androidin-app-purchasewear-osandroid-wear-data-api

How do you enable Android Wear app with in-app purchase?


I'm trying to find a way to enable an Android Wear companion app only if the user has purchased it via an in-app purchase on their mobile device.

1) Is this possible?

2) How is it done?


Solution

  • As you cannot prevent the wearable APK from being synced to the watch, you need to verify if the user has "purchased" the wearable module when they try to launch it.

    Unfortunately, com.android.vending.billing.InAppBillingService is not available on Android Wear, so you'll have to do the following:

    1. Perform purchase and product purchase verification on mobile
    2. Use the DataLayer API so sync this information to the wearable module
    3. Use a WearableListenerService on the wearable to react to the purchase coming through and enabling the full set of features on the wearable module

    When the user launches the wearable app before making the purchase, you should show them a friendly message and ask them to perform the purchase in the mobile app.