Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 1 | page.title=Testing In-app Billing |
| 2 | parent.title=In-app Billing |
| 3 | parent.link=index.html |
| 4 | @jd:body |
| 5 | |
| 6 | <div id="qv-wrapper"> |
| 7 | <div id="qv"> |
| 8 | <h2>In this document</h2> |
| 9 | <ol> |
Dirk Dougherty | c80197d | 2013-05-14 19:14:11 -0700 | [diff] [blame] | 10 | <li><a href="#testing-purchases">Testing In-app Purchases</a></li> |
Andrew Solovay | aee20f9 | 2014-05-29 15:26:58 -0700 | [diff] [blame] | 11 | <li><a href="#billing-testing-static">Testing with Static Responses</a></li> |
Dirk Dougherty | c80197d | 2013-05-14 19:14:11 -0700 | [diff] [blame] | 12 | <li><a href="#billing-testing-real">Setting Up for Test Purchases</a></li> |
Andrew Solovay | aee20f9 | 2014-05-29 15:26:58 -0700 | [diff] [blame] | 13 | <li><a href="#draft_apps">Draft Apps are No Longer Supported</a></li> |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 14 | </ol> |
| 15 | <h2>See also</h2> |
| 16 | <ol> |
Dirk Dougherty | 2b286bb | 2012-11-29 17:25:09 -0800 | [diff] [blame] | 17 | <li><a href="{@docRoot}google/play/billing/billing_overview.html">Overview of In-app |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 18 | Billing</a></li> |
Quddus Chong | 768dba6 | 2012-12-08 17:06:30 -0800 | [diff] [blame] | 19 | <ol> |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 20 | </div> |
| 21 | </div> |
| 22 | |
Dirk Dougherty | aca4a77 | 2012-09-04 18:09:08 -0700 | [diff] [blame] | 23 | <p>The Google Play Developer Console provides several tools that help you test your In-app Billing |
Dirk Dougherty | c80197d | 2013-05-14 19:14:11 -0700 | [diff] [blame] | 24 | implementation:</p> |
| 25 | |
| 26 | <ul> |
| 27 | <li>Test purchases, which let test account users make real purchase your published in-app items, |
| 28 | but without any actual charges to the user accounts.</li> |
| 29 | <li>Static billing responses from Google Play, for testing in early development</p> |
| 30 | </ul> |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 31 | |
Quddus Chong | 768dba6 | 2012-12-08 17:06:30 -0800 | [diff] [blame] | 32 | <p>To test In-app Billing in an application you must install the application on an Android-powered |
| 33 | device. You cannot use the Android emulator to test In-app Billing. The device you use for testing |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 34 | must run a standard version of the Android 1.6 or later platform (API level 4 or higher), and have |
| 35 | the most current version of the Google Play application installed. If a device is not running the |
Quddus Chong | 768dba6 | 2012-12-08 17:06:30 -0800 | [diff] [blame] | 36 | most current Google Play application, your application won't be able to send In-app Billing |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 37 | requests to Google Play. For general information about how to set up a device for use in |
| 38 | developing Android applications, see <a href="{@docRoot}tools/device.html">Using Hardware |
| 39 | Devices</a>.</p> |
| 40 | |
Dirk Dougherty | c80197d | 2013-05-14 19:14:11 -0700 | [diff] [blame] | 41 | <h2 id="testing-purchases">Testing In-app Purchases</h2> |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 42 | |
Dirk Dougherty | c80197d | 2013-05-14 19:14:11 -0700 | [diff] [blame] | 43 | <p>When your In-app Billing implementation is ready, you can test purchasing of your in-app SKUs in two ways:</p> |
| 44 | |
| 45 | <ul> |
| 46 | <li><strong>Test purchases</strong>, which let your selected license test users |
| 47 | purchase your in-app products before the app is published, but without any |
| 48 | resulting charges to the user, and </li> |
| 49 | <li><strong>Real purchases</strong>, which let regular users make real purchases |
| 50 | of your in-app products with actual charges to the user’s payment instruments. |
| 51 | In this case, you can use Google Play’s alpha and beta release groups to manage |
| 52 | the users who can make “live” purchases using your implementation. </li> |
| 53 | </ul> |
| 54 | |
| 55 | <p>The sections below provide more detail about how to use these approaches for |
| 56 | testing and validation. </p> |
| 57 | |
| 58 | <h3 id="test-purchases">Test Purchases (In-app Billing Sandbox)</h3> |
| 59 | |
| 60 | <p>Test purchases offer a secure, convenient way to enable larger-scale testing |
| 61 | of your In-app Billing implementation during development or in preparation for |
| 62 | launch. They let authorized user accounts make purchases of your in-app products |
| 63 | through Google Play while the app is still unpublished, without incurring any |
| 64 | actual charges to the user accounts.</p> |
| 65 | |
| 66 | <p>Once authorized with testing access, those users can side-load your app and |
| 67 | test the full merchandising, purchase, and fulfillment flow for your products. |
| 68 | Test purchases are real orders and Google Play processes them in the same way as |
| 69 | other orders. When purchases are complete, Google Play prevents the orders from |
| 70 | going to financial processing, ensuring that there are no actual charges to user |
| 71 | accounts, and automatically canceling the completed orders after 14 days. </p> |
| 72 | |
| 73 | <h4 id="setup">Setting up test purchases</h4> |
| 74 | |
| 75 | <p>It’s easy to set up test purchases—any user account can be chosen to be |
| 76 | a test account, and any user of a test account can make test purchases with any |
| 77 | available payment method (even though there’s no charge to the payment |
| 78 | method).</p> |
| 79 | |
| 80 | <p>First, upload and publish in-app products that you want testers to be able to |
| 81 | purchase. You can upload and publish in-app products in the Developer Console. |
| 82 | Note that you can upload and publish your in-app items before you publish the |
Andrew Solovay | aee20f9 | 2014-05-29 15:26:58 -0700 | [diff] [blame] | 83 | APK itself.</p> |
Dirk Dougherty | c80197d | 2013-05-14 19:14:11 -0700 | [diff] [blame] | 84 | |
quddusc | 9c1f719 | 2014-01-02 11:39:02 -0800 | [diff] [blame] | 85 | <p>Next, create license test accounts for authorized users. In the Developer |
Dirk Dougherty | c80197d | 2013-05-14 19:14:11 -0700 | [diff] [blame] | 86 | Console, go to <strong>Settings</strong> > <strong>Account details</strong>, |
| 87 | then in the License Testing section, add the addresses to <strong>Gmail accounts |
quddusc | 9c1f719 | 2014-01-02 11:39:02 -0800 | [diff] [blame] | 88 | with testing access</strong> field. For more information, see <a |
Dirk Dougherty | c80197d | 2013-05-14 19:14:11 -0700 | [diff] [blame] | 89 | href="#billing-testing-test">Setting Up for Test Purchases</a>.</p> |
| 90 | |
| 91 | <p>Once you’ve added the users as license tester accounts and saved the change, |
| 92 | within 15 minutes those users can begin making test purchases of your in-app |
| 93 | products. You can then distribute your app to your testers and provide a means |
| 94 | of getting feedback. </p> |
| 95 | |
| 96 | <p class="note"><strong>Note</strong>: To make test purchases, the license test |
| 97 | account must be on the user’s Android device. If the device has more than one |
| 98 | account, the purchase will be made with the account that downloaded the app. If |
| 99 | none of the accounts has downloaded the app, the purchase is made with the first |
| 100 | account.Users can confirm the account that is making a purchase by expanding the |
| 101 | purchase dialog.</p> |
| 102 | |
| 103 | <h4 id="tp-account">Test purchases and developer account</h4> |
| 104 | <p>Authorized license test accounts are associated with your developer account |
| 105 | in Google Play, rather than with a specific APK or package name. Identifying an |
| 106 | account as a test account enables it to purchase any of your in-app products |
| 107 | without being charged. </p> |
| 108 | |
| 109 | <h4 id="purchase-flow">Details of purchase flow</h4> |
| 110 | <p>During a test purchase, users can test the actual merchandising, purchase, |
| 111 | and fulfillment flow in your app. During purchase, the inapp item is displayed |
| 112 | as a normal item with an actual price. However, Google Play marks test purchases |
| 113 | with a notice across the center of the purchase dialog, for easy identification. |
| 114 | </p> |
| 115 | |
| 116 | <h4 id="cancelling">Cancelling completed test purchases</h4> |
| 117 | <p>Google Play accumulates completed test purchases for each user but does not |
| 118 | pass them on to financial processing. Over time, it automatically clears out |
| 119 | the purchases by cancelling them. </p> |
| 120 | |
| 121 | <p>In some cases, you might want to manually cancel a test purchase to continue |
| 122 | testing. For cancelling purchases, you have these options:</p> |
| 123 | |
| 124 | <ul> |
| 125 | <li>Wait for the transactions to expire—Google Play clears completed test |
| 126 | purchases 14 days after their purchase date. </li> |
| 127 | <li>Cancel purchases manually—you can go to the Google Wallet Merchant |
| 128 | Center, look up the transaction, and then cancel it. You can find transactions |
| 129 | by looking up their order numbers.</li> |
| 130 | </ul> |
| 131 | |
| 132 | <h4 id="requirements">Requirements for using test purchases</h4> |
| 133 | <p>If you plan to use test purchases, please note the requirements and limitations below: </p> |
| 134 | <ul> |
| 135 | <li>Test purchases is only supported for license test accounts when the app is using the In-app Billing v3 API.</li> |
| 136 | <li>Test purchases are only supported for in-app products, not for in-app subscriptions.</li> |
| 137 | </ul> |
| 138 | |
| 139 | <h3 id="transations">Testing with real transactions</h3> |
| 140 | <p>As you prepare to launch an app that uses In-app Billing, you can make use of |
| 141 | Google Play alpha/beta release options to do validation and load testing on your |
| 142 | implementation before distributing the app to all of your users. </p> |
| 143 | |
| 144 | <p>With alpha/beta test groups, real users (chosen by you) can install your app |
| 145 | from Google Play and test your in-app products. They can make real purchases |
| 146 | that result in actual charges to their accounts, using any of their normal |
| 147 | payment methods in Google Play to make purchases. Note that if you include test |
| 148 | license accounts in your alpha and beta distribution groups, those users will |
| 149 | only be able to make test purchases. </p> |
| 150 | |
| 151 | |
Andrew Solovay | aee20f9 | 2014-05-29 15:26:58 -0700 | [diff] [blame] | 152 | <h2 id="billing-testing-static">Testing with Static Responses</h2> |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 153 | |
Quddus Chong | 768dba6 | 2012-12-08 17:06:30 -0800 | [diff] [blame] | 154 | <p>We recommend that you first test your In-app Billing implementation using static responses from |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 155 | Google Play. This enables you to verify that your application is handling the primary Google |
Andrew Solovay | aee20f9 | 2014-05-29 15:26:58 -0700 | [diff] [blame] | 156 | Play responses correctly and that your application is able to verify signatures correctly. You can do this |
| 157 | even if the app hasn't been published yet.</p> |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 158 | |
Quddus Chong | 768dba6 | 2012-12-08 17:06:30 -0800 | [diff] [blame] | 159 | <p>To test your implementation with static responses, you make an In-app Billing request using a |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 160 | special item that has a reserved product ID. Each reserved product ID returns a specific static |
Quddus Chong | 768dba6 | 2012-12-08 17:06:30 -0800 | [diff] [blame] | 161 | response from Google Play. No money is transferred when you make In-app Billing requests with the |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 162 | reserved product IDs. Also, you cannot specify the form of payment when you make a billing request |
| 163 | with a reserved product ID. Figure 1 shows the checkout flow for the reserved item that has the |
| 164 | product ID android.test.purchased.</p> |
| 165 | |
| 166 | <img src="{@docRoot}images/billing_test_flow.png" height="381" id="figure1" /> |
| 167 | <p class="img-caption"> |
Dirk Dougherty | b973b3a | 2012-12-04 17:55:18 -0800 | [diff] [blame] | 168 | <strong>Figure 1.</strong>Wallet flow for the special reserved item android.test.purchased. |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 169 | </p> |
| 170 | |
| 171 | <p>You do not need to list the reserved products in your application's product list. Google Play |
| 172 | already knows about the reserved product IDs. Also, you do not need to upload your application to |
Dirk Dougherty | aca4a77 | 2012-09-04 18:09:08 -0700 | [diff] [blame] | 173 | the Developer Console to perform static response tests with the reserved product IDs. You can simply |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 174 | install your application on a device, log into the device, and make billing requests using the |
| 175 | reserved product IDs.</p> |
| 176 | |
Andrew Solovay | aee20f9 | 2014-05-29 15:26:58 -0700 | [diff] [blame] | 177 | <p class="note"><strong>Note:</strong> Previously you could test an app by |
| 178 | uploading an unpublished "draft" version. This functionality is no longer |
| 179 | supported. However, you can test your app with static responses even before you |
| 180 | upload it to the Google Play store. For more information, see <a |
| 181 | href="#draft_apps">Draft Apps are No Longer Supported</a>. |
| 182 | |
Quddus Chong | 768dba6 | 2012-12-08 17:06:30 -0800 | [diff] [blame] | 183 | <p>There are four reserved product IDs for testing static In-app Billing responses:</p> |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 184 | |
| 185 | <ul> |
| 186 | <li><strong>android.test.purchased</strong> |
Quddus Chong | 768dba6 | 2012-12-08 17:06:30 -0800 | [diff] [blame] | 187 | <p>When you make an In-app Billing request with this product ID, Google Play responds as |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 188 | though you successfully purchased an item. The response includes a JSON string, which contains |
| 189 | fake purchase information (for example, a fake order ID). In some cases, the JSON string is |
| 190 | signed and the response includes the signature so you can test your signature verification |
| 191 | implementation using these responses.</p> |
| 192 | </li> |
| 193 | <li><strong>android.test.canceled</strong> |
Quddus Chong | 768dba6 | 2012-12-08 17:06:30 -0800 | [diff] [blame] | 194 | <p>When you make an In-app Billing request with this product ID Google Play responds as |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 195 | though the purchase was canceled. This can occur when an error is encountered in the order |
| 196 | process, such as an invalid credit card, or when you cancel a user's order before it is |
| 197 | charged.</p> |
| 198 | </li> |
| 199 | <li><strong>android.test.refunded</strong> |
Quddus Chong | 768dba6 | 2012-12-08 17:06:30 -0800 | [diff] [blame] | 200 | <p>When you make an In-app Billing request with this product ID, Google Play responds as |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 201 | though the purchase was refunded. Refunds cannot be initiated through Google Play's in-app |
| 202 | billing service. Refunds must be initiated by you (the merchant). After you process a refund |
Dirk Dougherty | 974af93 | 2013-04-22 13:03:11 -0700 | [diff] [blame] | 203 | request through your Google Wallet merchant account, a refund message is sent to your application by |
| 204 | Google Play. This occurs only when Google Play gets notification from Google Wallet that |
Quddus Chong | 768dba6 | 2012-12-08 17:06:30 -0800 | [diff] [blame] | 205 | a refund has been made. For more information about refunds, see <a href="{@docRoot}google/play/billing/v2/api.html#billing-action-notify">Handling |
| 206 | IN_APP_NOTIFY messages</a> and <a href="http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=1153485">In-app Billing |
| 207 | Pricing</a>.</p> |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 208 | </li> |
| 209 | <li><strong>android.test.item_unavailable</strong> |
Quddus Chong | 768dba6 | 2012-12-08 17:06:30 -0800 | [diff] [blame] | 210 | <p>When you make an In-app Billing request with this product ID, Google Play responds as |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 211 | though the item being purchased was not listed in your application's product list.</p> |
| 212 | </li> |
| 213 | </ul> |
| 214 | |
Andrew Solovay | aee20f9 | 2014-05-29 15:26:58 -0700 | [diff] [blame] | 215 | <p>In some cases, the reserved items may return signed static responses, which |
| 216 | lets you test signature verification in your application. The reserved items |
| 217 | only return signed responses if the user running the application has a <a |
| 218 | href="{@docRoot}distribute/googleplay/start.html">developer</a> or <a |
| 219 | href="{@docRoot}google/play/billing/billing_admin.html#billing-testing-setup">test |
| 220 | account.</a> |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 221 | |
Quddus Chong | 768dba6 | 2012-12-08 17:06:30 -0800 | [diff] [blame] | 222 | <p>To make an In-app Billing request with a reserved product ID, you simply construct a normal |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 223 | <code>REQUEST_PURCHASE</code> request, but instead of using a real product ID from your |
| 224 | application's product list you use one of the reserved product IDs.</p> |
| 225 | |
| 226 | <p>To test your application using the reserved product IDs, follow these steps:</p> |
| 227 | |
| 228 | <ol> |
| 229 | <li><strong>Install your application on an Android-powered device.</strong> |
Quddus Chong | 768dba6 | 2012-12-08 17:06:30 -0800 | [diff] [blame] | 230 | <p>You cannot use the emulator to test In-app Billing; you must install your application on a |
| 231 | device to test In-app Billing.</p> |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 232 | <p>To learn how to install an application on a device, see <a |
| 233 | href="{@docRoot}tools/building/building-cmdline.html#RunningOnDevice">Running on a |
| 234 | device</a>.</p> |
| 235 | </li> |
| 236 | <li><strong>Sign in to your device with your developer account.</strong> |
| 237 | <p>You do not need to use a test account if you are testing only with the reserved product |
| 238 | IDs.</p> |
| 239 | </li> |
| 240 | <li><strong>Verify that your device is running a supported version of the Google Play |
| 241 | application or the MyApps application.</strong> |
Quddus Chong | 768dba6 | 2012-12-08 17:06:30 -0800 | [diff] [blame] | 242 | <p>If your device is running Android 3.0, In-app Billing requires version 5.0.12 (or higher) of |
| 243 | the MyApps application. If your device is running any other version of Android, In-app Billing |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 244 | requires version 2.3.4 (or higher) of the Google Play application. To learn how to check the |
| 245 | version of the Google Play application, see <a |
| 246 | href="http://market.android.com/support/bin/answer.py?answer=190860">Updating Google |
| 247 | Play</a>.</p> |
| 248 | </li> |
| 249 | <li><strong>Run your application and purchase the reserved product IDs.</strong></li> |
| 250 | </ol> |
| 251 | |
Quddus Chong | 768dba6 | 2012-12-08 17:06:30 -0800 | [diff] [blame] | 252 | <p class="note"><strong>Note</strong>: Making In-app Billing requests with the reserved product IDs |
| 253 | overrides the usual Google Play production system. When you send an In-app Billing request for a |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 254 | reserved product ID, the quality of service will not be comparable to the production |
| 255 | environment.</p> |
| 256 | |
Dirk Dougherty | c80197d | 2013-05-14 19:14:11 -0700 | [diff] [blame] | 257 | <h2 id="billing-testing-test">Setting Up for Test Purchases</h2> |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 258 | |
| 259 | <p>After you finish your static response testing, and you verify that signature verification is |
Quddus Chong | 768dba6 | 2012-12-08 17:06:30 -0800 | [diff] [blame] | 260 | working in your application, you can test your In-app Billing implementation by making actual in-app |
| 261 | purchases. Testing real in-app purchases enables you to test the end-to-end In-app Billing |
Dirk Dougherty | c80197d | 2013-05-14 19:14:11 -0700 | [diff] [blame] | 262 | experience, including the actual purchases from Google Play and the actual checkout flow that |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 263 | users will experience in your application.</p> |
| 264 | |
Andrew Solovay | aee20f9 | 2014-05-29 15:26:58 -0700 | [diff] [blame] | 265 | <p class="note"><strong>Note:</strong> You can do end-to-end testing of your app |
| 266 | by publishing it to an <a |
| 267 | href="{@docRoot}distribute/googleplay/developer-console.html#alpha-beta">alpha |
| 268 | distribution channel</a>. This allows you to publish the app to the Google |
| 269 | Play store, but limit its availability to just the testers you designate. </p> |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 270 | |
Quddus Chong | 768dba6 | 2012-12-08 17:06:30 -0800 | [diff] [blame] | 271 | <p>To test your In-app Billing implementation with actual in-app purchases, you will need to |
Dirk Dougherty | aca4a77 | 2012-09-04 18:09:08 -0700 | [diff] [blame] | 272 | register at least one test account on the Google Play Developer Console. You cannot use your |
Dirk Dougherty | 974af93 | 2013-04-22 13:03:11 -0700 | [diff] [blame] | 273 | developer account to test the complete in-app purchase process because Google Wallet does not let |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 274 | you buy items from yourself. If you have not set up test accounts before, see <a |
Dirk Dougherty | 2b286bb | 2012-11-29 17:25:09 -0800 | [diff] [blame] | 275 | href="{@docRoot}google/play/billing/billing_admin.html#billing-testing-setup">Setting up test |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 276 | accounts</a>.</p> |
| 277 | |
| 278 | <p>Also, a test account can purchase an item in your product list only if the item is published. The |
| 279 | application does not need to be published, but the item does need to be published.</p> |
| 280 | |
Quddus Chong | 768dba6 | 2012-12-08 17:06:30 -0800 | [diff] [blame] | 281 | <p>To test your In-app Billing implementation with actual purchases, follow these steps:</p> |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 282 | |
| 283 | <ol> |
Andrew Solovay | aee20f9 | 2014-05-29 15:26:58 -0700 | [diff] [blame] | 284 | <li><strong>Upload your application to the <a |
| 285 | href="{@docRoot}distribute/googleplay/developer-console.html#alpha-beta">alpha |
| 286 | distribution channel</a> with the Developer Console.</strong> |
| 287 | |
| 288 | <p class="note"><strong>Note:</strong> Previously you could test an app by |
| 289 | uploading an unpublished "draft" version. This functionality is no longer |
| 290 | supported; instead, you must publish it to the alpha or beta distribution |
| 291 | channel. For more information, see <a href="#draft_apps">Draft Apps are No |
| 292 | Longer Supported</a>. |
| 293 | |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 294 | </li> |
| 295 | <li><strong>Add items to the application's product list.</strong> |
| 296 | <p>Make sure that you publish the items (the application can remain unpublished). See <a |
Dirk Dougherty | 2b286bb | 2012-11-29 17:25:09 -0800 | [diff] [blame] | 297 | href="{@docRoot}google/play/billing/billing_admin.html#billing-catalog">Creating a product |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 298 | list</a> to learn how to do this.</p> |
| 299 | </li> |
| 300 | <li><strong>Install your application on an Android-powered device.</strong> |
Quddus Chong | 768dba6 | 2012-12-08 17:06:30 -0800 | [diff] [blame] | 301 | <p>You cannot use the emulator to test In-app Billing; you must install your application on a |
| 302 | device to test In-app Billing.</p> |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 303 | <p>To learn how to install an application on a device, see <a |
| 304 | href="{@docRoot}tools/building/building-cmdline.html#RunningOnDevice">Running on a |
| 305 | device</a>.</p> |
| 306 | </li> |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 307 | <li><strong>Verify that your device is running a supported version of the Google Play |
| 308 | application or the MyApps application.</strong> |
Quddus Chong | 768dba6 | 2012-12-08 17:06:30 -0800 | [diff] [blame] | 309 | <p>If your device is running Android 3.0, In-app Billing requires version 5.0.12 (or higher) of |
| 310 | the MyApps application. If your device is running any other version of Android, In-app Billing |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 311 | requires version 2.3.4 (or higher) of the Google Play application. To learn how to check the |
| 312 | version of the Google Play application, see <a |
| 313 | href="http://market.android.com/support/bin/answer.py?answer=190860">Updating Google |
| 314 | Play</a>.</p> |
| 315 | </li> |
| 316 | <li><strong>Make in-app purchases in your application.</strong></li> |
| 317 | </ol> |
| 318 | |
| 319 | <p class="note"><strong>Note:</strong> The only way to change the primary account on a device is to |
| 320 | do a factory reset, making sure you log on with your primary account first.</p> |
| 321 | |
Quddus Chong | 768dba6 | 2012-12-08 17:06:30 -0800 | [diff] [blame] | 322 | <p>When you are finished testing your In-app Billing implementation, you are ready to |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 323 | publish your application on Google Play. You can follow the normal steps for <a |
| 324 | href="{@docRoot}tools/publishing/preparing.html">preparing</a>, <a |
| 325 | href="{@docRoot}tools/publishing/app-signing.html">signing</a>, and <a |
Dirk Dougherty | 3506ac8 | 2014-02-21 11:15:52 -0800 | [diff] [blame] | 326 | href="{@docRoot}distribute/tools/launch-checklist.html">publishing on Google Play</a>. |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 327 | </p> |
| 328 | |
Andrew Solovay | aee20f9 | 2014-05-29 15:26:58 -0700 | [diff] [blame] | 329 | <h2 id="draft_apps">Draft Apps are No Longer Supported</h2> |
| 330 | |
| 331 | <p>Previously, you could publish a "draft" version of your app for testing. This |
| 332 | functionality is no longer supported. Instead, there are two ways you can test |
| 333 | how a pre-release app functions on the Google Play store:</p> |
| 334 | |
| 335 | <ul> |
| 336 | |
| 337 | <li>You can publish an app to the <a |
| 338 | href="{@docRoot}distribute/googleplay/developer-console.html#alpha-beta">alpha |
| 339 | or beta distribution channels</a>. This makes the app available on the Google |
| 340 | Play store, but only to the testers you put on a "whitelist".</li> |
| 341 | |
| 342 | <li>In a few cases, you can test Google Play functionality with an unpublished |
| 343 | app. For example, you can test an unpublished app's in-app billing support by |
| 344 | using <a |
| 345 | href="{@docRoot}google/play/billing/billing_testing.html#billing-testing-static">static |
| 346 | responses</a>, special reserved product IDs that always return a specific |
| 347 | result (like "purchased" or "refunded").</li> |
| 348 | |
| 349 | </ul> |