Monetize your app_with_google_subscriptions_v3_services_intuit

29
Monetize your app with Google Subscriptions V3 services: Benefits and best practices Manohar Mahapatra Intuit

Transcript of Monetize your app_with_google_subscriptions_v3_services_intuit

Page 1: Monetize your app_with_google_subscriptions_v3_services_intuit

Monetize your app with Google Subscriptions V3 services: Benefits and best practices

Manohar MahapatraIntuit

Page 2: Monetize your app_with_google_subscriptions_v3_services_intuit

Why choose Android In-App Billing

Page 3: Monetize your app_with_google_subscriptions_v3_services_intuit

Types of In-App Billing

• Standard in-app products (one-time billing)

• Subscriptions, (recurring, automated billing)

 

Page 4: Monetize your app_with_google_subscriptions_v3_services_intuit

Its Hassle Free

•Google Play handles all credit card related activities for the user of your app.

•Stores the card details along with Google Wallet . No need to enter the data again during the time of purchase.

•Charges the app user’s card and credits your Google Merchant account.

Page 5: Monetize your app_with_google_subscriptions_v3_services_intuit

Its Free for developers

•Any application that you publish through Google Play can implement In-app Billing.

•No special account or registration is required other than a Google Play Developer Console account and a Google Wallet merchant account.

Page 6: Monetize your app_with_google_subscriptions_v3_services_intuit

Preparing Your In-app Billing Application

Page 7: Monetize your app_with_google_subscriptions_v3_services_intuit

Download the Sample Application

•The sample files will be installed to <sdk>/extras/google/play_billing/.

Page 8: Monetize your app_with_google_subscriptions_v3_services_intuit

Add Your Application to the Developer Console

• In the Services & APIs tab, find and make a note of the public license key that Google Play generated for your application

Page 9: Monetize your app_with_google_subscriptions_v3_services_intuit

Add the In-app Billing Library

•To use the In-app Billing Version 3 features, you must add the IInAppBillingService.aidl file to your Android project.

•This Android Interface Definition Language (AIDL) file defines the interface to the Google Play service.

Page 10: Monetize your app_with_google_subscriptions_v3_services_intuit

IInAppBillingService.aidl

Page 11: Monetize your app_with_google_subscriptions_v3_services_intuit

Set the Billing Permission

•To have permission to communicate request and response messages to the Google Play’s billing service, add this line in your AndroidManifest.xml manifest file:

•<uses-permission android:name="com.android.vending.BILLING" />

Page 12: Monetize your app_with_google_subscriptions_v3_services_intuit

Initiate a Connection with Google Play

•You must bind your Activity to Google Play’s In-app Billing service to send In-app Billing requests to Google Play from your application.

Page 13: Monetize your app_with_google_subscriptions_v3_services_intuit

Establishing In-app Billing Products for Sale

Page 14: Monetize your app_with_google_subscriptions_v3_services_intuit

Specify In-app Products in Google Play

•Build a signed APK file for your In-app Billing application. Make sure that you are using your final (not debug) certificate and private key to sign your application.

•Click on the APK tab then click on Upload new APK. Don’t publish the app yet!

•Navigate to the uploaded app listing, and click on In-app Products.

Page 15: Monetize your app_with_google_subscriptions_v3_services_intuit
Page 16: Monetize your app_with_google_subscriptions_v3_services_intuit

•Complete the form to specify the product information such as the item’s unique product ID (also called its SKU), description, price, and country availability

•Once you have completed the form, activate the product so that your application can purchase.

Page 17: Monetize your app_with_google_subscriptions_v3_services_intuit
Page 18: Monetize your app_with_google_subscriptions_v3_services_intuit

Query Items Available for Purchase

•You can query Google Play to programmatically retrieve details of the in-app products that are associated with your application (such as the product’s price, title, description, and type)

Page 19: Monetize your app_with_google_subscriptions_v3_services_intuit
Page 20: Monetize your app_with_google_subscriptions_v3_services_intuit

Purchase an Item

•To start a purchase request from your app, call launchPurchaseFlow(Activity, String, int, OnIabPurchaseFinishedListener, String) on your IabHelper instance. You must make this call from the main thread of your Activity.

Page 21: Monetize your app_with_google_subscriptions_v3_services_intuit
Page 22: Monetize your app_with_google_subscriptions_v3_services_intuit

Query Purchased Items

•To retrieve the user’s purchases from your app, queryInventoryAsync(QueryInventoryFinishedListener) on your IabHelper instance. 

Page 23: Monetize your app_with_google_subscriptions_v3_services_intuit

Consume a Purchase

•You must send a consumption request for the item before Google Play makes it available for purchase again. All managed in-app products are consumable. Subscriptions need not be consumed.

Page 24: Monetize your app_with_google_subscriptions_v3_services_intuit

Testing Your In-app Billing Application

Page 25: Monetize your app_with_google_subscriptions_v3_services_intuit

Test with Static Responses

•Test your In-app Billing application with static responses by using Google Play’s reserved product IDs.•There are four reserved product IDs for testing static In-app Billing responses:

1. android.test.purchased2. android.test.canceled3. android.test.refunded4. android.test.item_unavailable

Page 26: Monetize your app_with_google_subscriptions_v3_services_intuit

Test with Your Own Product IDs

• In the Developer Console, add one or more tester accounts to the developer account that you are using to publish your application.– Click Settings > Account details, then in

the License Testing section, add the Google email addresses for your tester accounts.

•Build a signed and final (not debug) certificate APK file for your In-app Billing.

Page 27: Monetize your app_with_google_subscriptions_v3_services_intuit

•Make sure that you have uploaded the signed APK for your application to the Developer Console.You don't need to publish the application on Google Play to test

• Install the APK file to your physical test device by using the adb tool.

• Login to the test device by using a tester account.

Page 28: Monetize your app_with_google_subscriptions_v3_services_intuit

Important Security Considerations

•Perform signature verification tasks on a server so that this makes it difficult for attackers to break the verification process by reverse engineering your .apk file.

•Modify all sample application code

•Set the developer payload string when making purchase requests.

•Protect your Google Play public key.

Page 29: Monetize your app_with_google_subscriptions_v3_services_intuit

Thank You