1excludeFromSuggestions=true 2page.title=In-app Billing Version Notes 3@jd:body 4 5<p> 6 The In-app Billing API is versioned, with each version offering additional 7 features to your app. API support is provided by the Google Play Store app. 8 On most devices, the Google Play Store app is updated automatically to 9 support newer versions of the API. 10</p> 11 12<p>The sections below list the supported versions of the In-app Billing API.</p> 13 14<p id="api_check"><strong><em>How to check for In-app Billing version</em></strong></p> 15 16<p> 17 At run time, your app can query the Google Play Store app to determine what 18 version of the API it supports and what features are available. 19</p> 20 21<ul> 22 23<li>If you are using in-app billing version 3 or later, the version information 24is not directly returned by Google Play. Instead, you can check if Google Play 25supports the version of the In-app Billing API that you are using by sending an 26{@code isBillingSupported} request.</li> 27 28<li>If the In-app Billing API version that you are using is earlier than version 293, the version information is returned in the <code>API_VERSION</code> key of 30the Bundle object passed in the {@code sendBillingRequest} method. For more 31information, see 32<a href="{@docRoot}google/play/billing/v2/billing_reference.html#billing-interface-v2"> 33In-app Billing Service Interface</a>.</li> 34</ul> 35 36<h3 id="version_5">In-app Billing version 5</h3> 37<p><em>February 2015</em></p> 38<ul> 39<li>A user can manually extend an existing subscription. The subscription 40is extended by the appropriate amount of time.</li> 41<li>A user can upgrade or downgrade a subscription while it is active. The 42old subscription is canceled, and the unused portion is applied on a pro-rata 43basis to the new subscription.</li> 44</ul> 45 46<h3 id="version_4">In-app Billing version 4</h3> 47 48<p>Version 4 of the In-app Billing API did not introduce any public 49functionality.</p> 50 51<h3 id="version_3">In-app Billing version 3</h3> 52<p><em>February 2013</em></p> 53<ul> 54<li>Purchasing and querying managed in-app items requires Google Play client 55version 3.9.16 or higher.</li> 56<li>Purchasing and querying subscription items requires Google Play client 57version 3.10.10 or higher.</li> 58<li>Provides a new Android Interface Definition Language (AIDL) file named 59 {@code IInAppBillingService.aidl}. The new interface offers these features: 60<ul> 61<li>Provides a new API to get details of in-app items published for the app including price, type, 62 title and description.</li> 63<li>The purchase flow is synchronous and purchase information is available immediately after it 64 completes.</li> 65<li>Purchase information of in-app purchases is maintained within the Google Play system till the 66 purchase is consumed.</li> 67<li>An API to consume a purchase of an inapp item. All purchases of one-time in-app items are 68 consumable and thereafter can be purchased again.</li> 69<li>An API to get current purchases of the user immediately. This list will not contain any consumed 70 purchases.</li> 71</ul> 72</li> 73</ul> 74 75<h3 id="version_2">In-app Billing version 2</h3> 76<p><em>May 2012</em></p> 77<ul> 78 <li>Adds support for subscriptions, including free trial period.</li> 79 <li>Adds a new supported string value, "2", for the <code>API_VERSION</code> key of the Bundle 80 object passed in the <code>sendBillingRequest()</code>.</li> 81 <li>Adds a new JSON field, <code>purchaseToken</code>, to the <code>orders</code> list returned in 82 a <code>PURCHASE_STATE_CHANGED</code> intent. </li> 83 <li>Adds a new <code>purchaseState</code> value, <code>3</code> (expired), to the 84 <code>orders</code> list returned in a <code>PURCHASE_STATE_CHANGED</code> intent. The value 85 indicates that a subscription has expired and is no longer valid.</li> 86<li>Requires Google Play (Play Store) version 3.5 or higher.</li> 87</ul> 88 89<h3 id="version_1">In-app Billing version 1</h3> 90<p><em>March 2011</em></p> 91<ul> 92<li>Initial release.</li> 93<li>Requires Google Play/Android Market 2.3.4 or higher.</li> 94</ul> 95