Integrating in-app billing

When Google Play is set up to handle in-app billing, the app must first connect to the Google Play service before it can request product details and make purchases.

Getting ready

Before the app can connect to Google Play, we need to create an app listing on the Google Play Developer Console (http://play.google.com/apps/publish).

How to do it...

Our first requirement before adding in-app billing to our app is the app's public key from Google Play:

  1. We need to copy the Base64-encoded public key from the console under the app's Services & APIs section:
    How to do it...

    The public app license key

  2. Then, we paste that key into our app. For testing purposes, ...

Get Xamarin Mobile Development for Android Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.