Can a test account be created on the developer's phone? - android

In my game I have InApp Purchases. I want to test my game before publishing, so I uploaded it to alpha. I would love to test it on my phone, but google refuse, saying a developer can't buy his own products. Google also refuse to allow emulators to purshase items.
Yesterday I added a google account to my phone, and added it to the list of people allowed to download my app (Gmail accounts with testing access).
My problem is that I can't access my game (We're sorry, the requested URL was not found on this server). My game is available (I checked it from another phone and its good). I simply can't access it from my test account.
What can I do? Should I do something, or I will not be able to test my game on my phone no matter what?

Here is the android developer help for testing in-app purchases. The second account you added should be able to access the game shortly. In my experience, it usually takes up to about 24 hours to access alpha/beta testing once a user has been added.
Here's some specific stuff from that post:
Test Purchases (In-app Billing Sandbox)
Test purchases offer a secure, convenient way to enable larger-scale testing of your In-app Billing implementation during development or in preparation for launch. They let authorized user accounts make purchases of your in-app products through Google Play without incurring any actual charges to the user accounts.
Once authorized for testing access, those users can make purchases without being charged. Test purchases are real orders and Google Play processes them in the same way as other orders. When purchases are complete, Google Play prevents the orders from going to financial processing, ensuring that there are no actual charges to user accounts, and automatically canceling the completed orders after 14 days.
We recommend that you first test your In-app Billing implementation using static responses from Google Play. This enables you to verify that your application is handling the primary Google Play responses correctly and that your application is able to verify signatures correctly. You can do this even if the app hasn't been published yet.
To test your implementation with static responses, you make an In-app Billing request using a special item that has a reserved product ID. Each reserved product ID returns a specific static response from Google Play. No money is transferred when you make In-app Billing requests with the reserved product IDs. Also, you cannot specify the form of payment when you make a billing request with a reserved product ID.

Related

Android: get real in-app purchases instead of test purchases

Currently, I added a billing processor for my store. All test in-app purchases are working but when will they expire/remove for real IAP?
I would like to know where test IAP are based on.
Did I receive a test IAP because I am and a tester or just because the app is not released and still on beta?
Quoting Android Docs http://www.androiddocs.com/google/play/billing/billing_testing.html
Test purchases offer a secure, convenient way to enable larger-scale testing of your In-app Billing implementation during development or in preparation for launch. They let authorized user accounts make purchases of your in-app products through Google Play while the app is still unpublished, without incurring any actual charges to the user accounts.
Once authorized with testing access, those users can side-load your app and test the full merchandising, purchase, and fulfillment flow for your products. Test purchases are real orders and Google Play processes them in the same way as other orders. When purchases are complete, Google Play prevents the orders from going to financial processing, ensuring that there are no actual charges to user accounts, and automatically canceling the completed orders after 14 days.
During development, the purchases will be testing purchases because the app is not signed. On a signed release, they will be test purchases if the app is not published.

Android in-app Billing with multiple users on one device

I have an application which supports in-app billing. However a user can login to this app using multiple accounts or he can even register a new account.
Can I somehow use in-app billing, so that the purchases would be linked not to the google id, but exactly to the account which made the purchase.
For example:
User downloads the app to his phone and does the actions described below only on this device.
User logins using 123#gmail.com account.
He purchases subscription1 and proceeds with the payment.
He logs out.
Now he logins using 456#gmail.com account.
He can also purchase subscription1, as 456#gmail.com never purchased it. So he purchases subscription1 one more time.
He logs out.
Now both 123#gmail.com and 456#gmail.com accounts own this subscription.
Profit.
In-app-billing works through google services and all purchases will be verified for a current user. Starting from Android 4.2 you can create multiple user profiles on one device and in-app-billing will work as you described.
You may just log out/in but it takes time to synchronize some information and you may experience some glitches.

Android in app subscription testing

I want to test the in app subscription mechanism on android devices(In app billing V3. api).
How can I do this? I saw that testing with static responses is works only with the in app products. The beta/alpha testing supports the in app subscriptions?
Thank you.
You can test your app with in app purchase feature. you have to follow below steps for testing
Upload you final signed apk file to Google play.
Dont publish it
Add in app products
get in app products id and add to code
get base 64 key and add to product
sign apk and upload again
your app should be in draft mode
in you Google play account setting add your test account id
use the device which should have the primary account id similar to the one you have added on Google play test account.
Install signed apk you have uploaded to Google play to your device.
run application and test your features
Since there's no effective way to test subscription cancellation/renewal, I'm trusting Google's documentation that an expired subscription won't appear in purchased items (otherwise, whether cancelled but still valid, original or renewed, I don't care in my case).
To test the rest of my work flow I created a test consumable object so that I can re-buy/cancel it at will in the sandbox. This consumable simulates an active subscription. It's not full end-to-end testing, but given that Google's given us no better way to test subscriptions, it will at least give me a fair amount of confidence that my app behaves as expected, otherwise.
A few notes:
1) You can only test with a signed build. I added android:debuggable="true" to my AndroidManifest.xml (under
<application android:debuggable="true"...)
2) This way I can still connect and debug with breakpoints after installing via adb (you can attach to the process under the Devices view, normally visible in the DDMS perspective, look for the little green bug icon.)
So far, it's behaving as expected. I'm still in the process of testing but if I hit any snags I'll update.
In adittion to #Vaibhav-Agarwal if you only want test your app, you could have problems with the IDs (I have experienced with an app for a client).
In my case, to avoid this situation, I had to add a testing project with another special package (test.xxxx.xxxx.xxxx) and here add some in-app product with a trial of 7 days, then when I canceled a purchase I "only" had to wait 7 days to purchase again this subscription.
In this way also,you never had to make a refund, because the subscription with trial time, you haven't to pay until this trial time finish.
NOTE:
Draft Apps are No Longer Supported, you must use Alpha/Beta tester option
In spanish, you will read: "no se ha podido encontrar el elemento que intentabas comprar"
Google has been enhanced theirs In-app Billing testing options. I write this answer for those who coming through . Now, you can test In-app Billing in Sandbox as other platforms do. In order to do that you have to create license test accounts for authorized users.
In the Developer Console, go to Settings > Account details, then in the License Testing section, add the addresses to Gmail accounts with testing access field.
Notes :
Test subscription purchases recur daily, regardless of the product's subscription period.
Once you’ve added the users as license tester accounts and saved the change, within 15 minutes those users can begin making test purchases of your in-app products.
After you publish your app to an alpha or beta channel, your testers need to opt-in to your app’s alpha or beta test using the provided opt-in URL before they can make test purchases.
License test accounts must be on the user’s Android device. If the device has more than one account, the purchase will be made with the account that downloaded the app. If none of the accounts has downloaded the app, the purchase is made with the first account. Users can confirm the account that is making a purchase by expanding the purchase dialog.
For more visit the official documentation.
But you can test Google Play functionality with an unpublished app using static responses.

Which Google Play account does IabHelper use?

I'm implementing a shop of magazines. I need my magazines once be bought to be available at all user's devices. So, I need to synchronize information somehow. I think, it's logical to synchronize by user play market account.
I looked through google's example implementation of in-app billing Preparing Your In-app Billing Application, and I found this implementation easy enough to do my first app with in-app billing.
The quiestion is: which Google Play account does IabHelper use? For example, there're several Google accounts on device. How to specify which account should be chosen by IabHelper?
How to point to IabHelper which account to take if there're many of them at device?
Answer1:
you can use any of account you have. but remember one thing that use one account which is in your registered device (set google account when first time device started) because to test application, only test account user can buy the product until it will not published(in Google play market).
Answer2:
other users can see your product while your application will be published. You are uploading signed apk file with product id and base 64 key to verify that it is your application and your particular product id by the play store. so while any of other user will purchase that product , his Google account will be registered as the purchased product.
EDIT:
One more thing you should remember that test account and developer console account should not be equal.
Let me know you required more information.
Hope it will help you.

Testing Android In-App purchase with real products

im trying to test In App purchases for my android app:
I already read the android developer sites about testing and I already have worked successfully with the play stores build in test/fake product-items like android.test.purchased, android.test.canceled ...
Now I would like to test In App purchases with my own real products. Therefore I have specified my own products in the Google Play Store Developer Console.
My question:
According to the android developers guide, it should be possible to buy this real item without transferring real money, by simply adding a gmail Account into the App settings (under the section LICENSE TESTING) in the Play Store Developer Console.
LICENSE TESTING
In addition to the owner of this console the following
users will get the License test response from the application. They
can also make in-app purchases from APKs that have been uploaded but
not been published yet.
So if login to google play store on my test device with a gmail account, that I have added to this LICENSE TESTING section, I should be able to buy items, without transferring real money? Did I get it right? Has anyone experience with testing in app purchases and can give me some useful advises?
From my recent experience.
With a different gmail account from the developer it is possible to buy in app purchases which are published for an app that has been uploaded but not published. You have to exchange real money but it is possible to refund the money. I think you would lose the 30% transaction fee to Google.
Don't know if this is relevant, but here's a good guide for testing purchases, including test purchase accounts in google:
http://developer.android.com/google/play/billing/billing_testing.html
With a test account the IAP will not be charged.
http://developer.android.com/google/play/billing/billing_testing.html
"Test purchases and developer account
Authorized license test accounts are associated with your developer account in Google Play, rather than with a specific APK or package name. Identifying an account as a test account enables it to purchase any of your in-app products without being charged. "

Categories

Resources