Monetize your app_with_google_subscriptions_v3_services_intuit

Post on 19-May-2015

208 views 0 download

Tags:

Transcript of Monetize your app_with_google_subscriptions_v3_services_intuit

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

Manohar MahapatraIntuit

Why choose Android In-App Billing

Types of In-App Billing

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

• Subscriptions, (recurring, automated billing)

 

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.

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.

Preparing Your In-app Billing Application

Download the Sample Application

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

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

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.

IInAppBillingService.aidl

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" />

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.

Establishing In-app Billing Products for Sale

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.

•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.

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)

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.

Query Purchased Items

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

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.

Testing Your In-app Billing Application

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

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.

•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.

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.

Thank You