Test your In-app Billing program
To ensure that In-app billing can be used normally in your program, you should test the app before posting it to Google Play. Early testing helps ensure that users are not confused or unresponsive to your purchase process, and that they can see their new purchases in a timely manner.
Using static response Testing
You can test your program in a static manner using the product ID that is reserved on Google Play. When you test a purchase by using a reserved product ID instead of a real product ID, you can use no real payment method or remittance. For more information on what to keep, see testing In-app billing.
Use your own Product ID to test
Because Google play does not allow you to use a developer account to directly purchase an in-store product that you previously created using your developer account, you will need to create an available test account below the developer account. Simply fill out an available Google email address and you can create a test account. Users who have these test accounts can test in-app purchases in apps that you haven't uploaded yet.
Use your own Product ID to test the In-app billing Version 3 app:
- In the developer console, add one or more beta accounts to your app's developer account.
- Log in to Developer Console using your developer account.
- Click Settings > Account Details, then add your beta user's Google email address in the License testing section.
- Create a signature apk file for your In-app billing program. How to generate and sign the APK, see Building Your application for Release. Make sure that the certificate and the private Key you signed are the final version, not the debug version.
- Make sure you have uploaded the signed apk to the developer console and created the relevant in-app purchases for your application. To test the program, you don't have to publish the program to Google play right now.
Warning: after you upload your app to the background, Google play may take up to 2-3 hours to confirm your updated APK version (the translator note: It may actually be half an hour to 1 hours). If you test your app before Google Play confirms your uploaded apk, you will receive a "Buy canceled" purchase response, along with an "In-app billing not available in the current version of the program" error message.
- Use the ADB to install the APK onto your real test device. Learn how to install applications, see running on a Device. Ensure:
Your test device is running an Android SDK version of 2.2 (API level 8) or higher, and the installed Google Play client version is 3.9.16 or higher.
- . You install the program on the Androidmanifest.xml in the
android:versionCode
and the android:versionName
the two attribute values are the same as the values in your developer console apk.
Before installing the program into your device, make sure that the same signature certificate that was uploaded to the apk used on the developer console is the same as the one you want to install.
5. Log in the test device with the tester's account. Buy some items in the program to test your In-app billing program and fix the problems you are experiencing. To learn more about how to test your In-app billing program in a wide range, see Test Purchases (In-app billing Sandbox).
O (∩_∩) o haha ~, the end of the series translation ~ ~ ~
Test your In-app Billing program