Which Google Play account does IabHelper use? - android

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.

Related

How to test IAB without being charged

I am trying to testIn App Purshase without being charged on Unity by reading this https://developer.android.com/google/play/billing/billing_testing.html
My application is published as an Alpha version, signed with a real key. I downloaded it with an other Google account that the one I used to publish the app. This account is both added in the testers list of Google Play Service and my app Alpha testers list.
The problem is, when I want to buy an item, I never see the word "test" as the documentation says.
Can someone explain to me which extra steps shall I do in order to be sure to test my In App Billing without being charged?
Thanks a lot.
A new version of Google Play Console was released the 17th April, and I think that the french version of the Google Play Console was not completely implemented.
Right now the section "Test de licence" is available.
Follow the Testing In-app Purchases:
Setting up test purchases
It’s easy to set up test purchases—any user account can be chosen to
be a test account, and any user of a test account can make test
purchases with any available payment method (even though there’s no
charge to the payment method).
First, upload and publish in-app products that you want testers to be
able to purchase. You can upload and publish in-app products in the
Developer Console. Note that you can upload and publish your in-app
items before you publish the APK itself.
Next, 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. For more information, see Setting Up for Test
Purchases.
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.

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

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.

Which user has installed an Android App?

When an user installs an Android App from Google Play, he/she has to login with a Google Account: does exists an Android API for getting which Google Account has been used for the App installation?
I would like to sell my App from Google Play, but I would give to the buyer a free trial period. I can't use subscriptions because they require a recurring payment (monthly or yearly), whereas I would set a una-tantum price.
When the trial period expire, I can use a non-consumable In-app product, but how can I manage the trial period?
Both Google Play Licensing and In-app Billing track purchase information on a per-user basis, thus they should be able to know which user has downloaded the App or who is the current user, and I too would like to know the same info in order to manage the trial period by means my web server.
If someone of you can suggest another way, I appreciate.
There is no such API to include in your app's code to keep record of user who have downloaded your app from Play Store. However before you upload your app to Play Store , you have to create a Developers account.
There google have provided Developer Console option, and this is where you will find download information for your app.

In-App Billing: Getting User is not eligible to purchase

I know about all the user account specification and where to register for the test account in developer console.
Question: To which user this message is referring?
The user that is currently logged in google play on device?
if yes. Why it is giving the same message even if there aren't any users logged in google play?
There is many google accounts on this device. maybe this message is referring to the default one. how to change it. (the default one: is when u clear google play data, then open google play it will force you to log in with).
When you are not logged in google play. why when you test in-app billing it does not ask for log in??
Thanks.
Your default Google Account will be used for purchasing... If you are unauthorized to buy items just make sure you add your device to the list of the test devices.
You default Google Account is the one you have registered at the first time on your device, I guess. Then you have to put that e-mail address on the list of "test devices" of your Google Play Developer Account and you will be able to purchase after some minutes.
If you want to use your own products you will need a real VISA to purchase. Alternatively, you can use static product IDs to purchase with a fake credit card.
Take a look at the Testing with static responses Google's official documentation to know when and what IDs you can use for testing purposes.

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