Skip to content

Commit 1c185c2

Browse files
ddoughertyAndroid (Google) Code Review
authored andcommitted
Merge "Doc change: Fixes to IAB purchase state docs." into jb-dev
2 parents d0e84d3 + 77cfe91 commit 1c185c2

File tree

4 files changed

+28
-14
lines changed

4 files changed

+28
-14
lines changed

docs/html/guide/google/play/billing/billing_overview.jd

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,9 @@ pertains to.</p>
353353

354354
<p>The <code>RESTORE_TRANSACTIONS</code> request type also triggers a
355355
<code>PURCHASE_STATE_CHANGED</code> broadcast intent, which contains the same type of transaction
356-
information that is sent during a purchase request, although you do not need to respond to this
357-
intent with a <code>CONFIRM_NOTIFICATIONS</code> message.</p>
356+
information that is sent during a purchase request. Unlike with a purchase request, however, the transactions
357+
are given without any associated notification IDs, so you do not need to respond to this
358+
intent with a <code>CONFIRM_NOTIFICATIONS</code> message. </p>
358359

359360
<p class="note"><strong>Note:</strong> You should use the <code>RESTORE_TRANSACTIONS</code> request
360361
type only when your application is installed for the first time on a device or when your

docs/html/guide/google/play/billing/billing_reference.jd

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -450,9 +450,7 @@ Google Play Android Developer API</a> for more information.</p>
450450
<p>The In-app Billing API is versioned, with each version offering
451451
additional features to your app. At run time, your app can query the Google Play app to determine
452452
what version of the API it supports and what features are available. Typically, the Google Play app
453-
will be updated and will support the latest version of the API. For a summary of versions see
454-
<a href="{@docRoot}guide/google/play/billing/billing_reference.html#billing-versions">In-app Billing
455-
API Versions</a>.</p>
453+
will be updated and will support the latest version of the API.
456454

457455
<p>The sections below list the supported versions of the In-app Billing API.
458456
Versions are specified in the <code>API_VERSION</code> key of the Bundle object

docs/html/guide/google/play/billing/billing_subscriptions.jd

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,10 @@ store the token locally or pass it to your backend servers, which can then use
241241
it to validate or cancel the subscription remotely using the <a
242242
href="#play-dev-api">Google Play Android Developer API</a>.</p>
243243

244-
<p>In the case of billing errors, such as could happen if the customer’s credit
245-
card becomes invalid, Google Play notifies your app of the change in purchase
246-
state.</p>
244+
<p>If a recurring payment fails, such as could happen if the customer’s credit
245+
card has become invalid, the subscription does not renew. Google Play notifies your
246+
app at the end of the active cycle that the purchase state of the subscription is now "Expired".
247+
Your app does not need to grant the user further access to the subscription content.</p>
247248

248249
<p>As a best practice, we recommend that your app includes business logic to
249250
notify your backend servers of subscription purchases, tokens, and any billing
@@ -626,13 +627,13 @@ purchased subscriptions at launch or prior to granting access to subscriber
626627
content.</p>
627628

628629
<p>With In-app Billing, you validate a subscription by keeping track of its
629-
purchase state, such as purchased or cancelled, and then checking the state
630-
whenever needed. Google Play provides two ways to let you know when the purchase
630+
purchase state and then checking the state whenever needed. Google Play
631+
provides two ways to let you know when the purchase
631632
state of a subscription changes:</p>
632633

633634
<ul>
634635
<li><em>In-app Billing Notifications</em>. Google Play pushes a notification
635-
to your app whenever the purchase state of a subscription changes. Your app can
636+
to your app to indicate a change in the purchase state of a subscription. Your app can
636637
store the most recent purchase state for a given purchase token and then check
637638
that state at run time, as needed.</li>
638639
<li><em>Google Play Android Developer API</em>. You can use this HTTP-based
@@ -689,7 +690,8 @@ values for subscription purchases, as received with a
689690
<td>Purchased successfully</td><td><code>0</code></td><td>Sent at original purchase only (not at recurring billing cycles).</td></tr>
690691
<td>Cancelled</td><td><code>1</code></td><td>Sent at original purchase only if the purchase has failed for some reason. </td></tr>
691692
<td>Refunded</td><td><code>2</code></td><td>The purchase was refunded.</code></td></tr>
692-
<td>Subscription expired</td><td><code>3</code></td><td>Sent if a subscription expires because of non-payment or user cancelation.</td></tr>
693+
<td>Subscription expired</td><td><code>3</code></td><td>Sent at the end of a billing cycle to indicate that the subscription expired without renewal because of non-payment or user-cancellation. Your app does not need to grant continued access to the subscription content.
694+
</td></tr>
693695
</table>
694696

695697

@@ -718,7 +720,7 @@ startActivity(intent);</pre>
718720
<p>For more information, see
719721
<a href="{@docRoot}distribute/googleplay/promote/linking.html">Linking to Your Products</a>.</p>
720722

721-
<h3 id="purchase-state-changes">Recurring billing and changes in purchase state</h3>
723+
<h3 id="purchase-state-changes">Recurring billing, cancellation, and changes in purchase state</h3>
722724

723725
<p>Google Play notifies your app when the user completes the purchase of a
724726
subscription, but the purchase state does not change over time, provided that
@@ -730,6 +732,19 @@ non-payment or user cancellation</em>. </p>
730732
recurring billing events &mdash; those are all handled by Google Play and they
731733
are transparent to your application if billing is successful.</p>
732734

735+
<p>When the user cancels a subscription during an active billing cycle, Google
736+
Play <em>does not</em> notify your app immediately of the change in purchase
737+
state. Instead, it waits until the end of the active billing cycle and then
738+
notifies your app that the purchase state has changed to "Expired". </p>
739+
740+
<p>Similarly, if payment for the next billing cycle fails, Google Play waits
741+
until the end of the active billing cycle and then notifies your app at that time that the
742+
purchase state has changed to "Expired".</p>
743+
744+
<p>Your app can handle user cancellation and non-payment in the same way, since both cause
745+
a change to the same "Expired" purchase state. Once the purchase state has become "Expired",
746+
your app does not need to grant further access to the subscription content.</p>
747+
733748
<h3 id="modifying">Modifying your app for subscriptions</h3>
734749

735750
<p>For subscriptions, you make the same types of modifications to your app as

docs/html/tools/index.jd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ page.title=Developer Tools
3434

3535
<ul>
3636
<li>Build rich Android UI with drag and drop.
37-
<li>Vsualize your UI on tablets, phones, and other devices. Switch themes, locales, even plaform versions instantly, without building.</li>
37+
<li>Visualize your UI on tablets, phones, and other devices. Switch themes, locales, even platform versions instantly, without building.</li>
3838
<li>Visual refactoring lets you extracts layout for inclusion, convert layouts, extract styles</li>
3939
<li>Editor support for working with custom UI components</li>
4040
</ul>

0 commit comments

Comments
 (0)