Testing Android In App Billing real purchases -


what conditions test real purchases, when have tested app using test product android.test.purchased?

there few steps need pass, remembering, of them need time update on google play servers.

for example, let's use com.example.product our real product id. time shows in example change own.

upload apk file

you can't test real purchases in debug mode. need download app beta, google know it's ok make purchases in app.

  1. check if have billing permission in androidmanifest.xml:

    <uses-permission android:name="com.android.vending.billing" /> 
  2. change android.test.purchased com.example.product,

  3. export *.apk file. must signed!
  4. publish apk in beta,
  5. you can go next steps, you'd need time beta ready download.

add new product

you can't add new product until have published beta.

you can't test subscriptions, products. can test subscriptions (they renewed every 24h)

  1. go products section in google play developer console,
  2. click add new product button , define new product com.example.product id,
  3. wait few hours until it's published.

testers

you can't test purchases being signed-in on device developer account. can't make purchases yourself.

  1. create testing group on google groups, or google plus,
  2. add gmail accounts of testers group,
  3. set group testers in google play developer console > app > beta
  4. copy testers emails in google play developer console > settings > license testing - make testing purchases enabled accounts.

testing

as tester, won't charged

when testing downloaded app beta, you'll see testing information on first iap dialog.

you'll see both product's name , price set in dev console.

you'll testing real payment options. don't scared of seeing credit card. mentioned before - won't charged.

when make test purchase, you'll confirmation e-mail, looks real purchase confirmation.

cleaning test purchases

to repeat same purchases, you'll need consume products, cancel purchases, or wait 2 weeks until testing purchases expire.

to cancel purchases:

  1. as developer, go google wallet, choose purchases, , cancel them (remember manage calceled purchases in app),
  2. as tester, go app manager on device, , clear google play cache. despite of canceling on developer side, device stores purchase information locally.

Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -