Google Play Product Id - google-play

[Edited as suggested by #Nick. Also made clearer the problem I am having. Also done a further edit to explain further.]
In my app on the Google Play Dashboard I have created an in app purchase called test1. So what is the product id I put in the following?
String productString = "test1";
bp.purchase(this, /* "YOUR PRODUCT ID FROM GOOGLE PLAY CONSOLE HERE" */ productString);
The purchase function is from Android In-App Billing v3 Library as noted by #Nick .
The error I am getting when I just have productString = "test1"; is it is saying:
Error
The item you requested is not available for purchase
When I do: bp.purchase(this, "com.mywebsite.jon.myappname.test1"); to make it look as much as possible like the test purchase example
I get the error from Google Play:
Error
Error while retreiving information fro server. [DF-AA-20]
​
I am not sure if this is important:
I am at the very early stage of testing in Internal Testing (not
Alpha or Beta testing).
My developer account and my purchaser accounts are different
I have the purchaser account email in my testers group

A product ID is described in the documentation here. It is:
"Product ID - A unique, human readable ID for your product. Product IDs are also called SKUs in the Google Play Billing Library."
If you called your in app purchase "test1" then it is "test1".
-------- Edit
One problem (or good thing) with using 3rd party libraries (which is what the one is you link to is) rather than the Google Libraries is you don't get the official documentation. Google has produced some ok documentation on testing in app billing.
I'd go through all the steps on that page, and if it still doesn't work say the step where you failed. I suspect what is going wrong is you haven't yet published your app to the Play store. Before a real in-app product is purchased (as opposed to the test product names like 'android.test.purchased') The app must be published.
Don't worry if you don't want to publish your app to the world yet. You can use an Internal Testing Track. An Internal test track publish won't be visible to anyone except the test accounts you add to it. And it won't affect your position in things like top charts for newly released apps. It is specifically there to test things like purchases or Google Play license verification.

Related

In-app Billing - Google Play gives me the "You already own this item" message when queryPurchases() returns an empty list

I just made one test purchase for an item, and it failed because my Wi-fi died, but for some reason Google Play then gave me a message that the order was pending or something and that I should check it on some link (I forgot to write it down).
When I tried to make that same test purchase again, Google Play gave me that "You already own this item" error. Said purchase is NOT in my order history in the Google Play dashboard.
What's going on, and how do I resolve this?
EDIT: Clearing the Google Play Store cache, clearing the Google Services Framework cache, and reinstalling the app does not work.
EDIT 2:
I managed to resolve this issue by Force Stopping the Google Play Store app, clearing its data, then restarting it. Right now, I can only conclude that the purchases made when the Wi-fi is disconnected is in the Play Store app's Data, not Cache.
My question thus becomes: Is it the developer's responsibility to handle this particular case (when the solution is not within the app itself), and how does one handle it?
I had the exact same issue, where I got the error message that I already own this item, but the getPurchases call returned an empty list.
What ended up working for me was getting the purchase history if this list is empty, and taking the purchase token for the last purchase of this specific product id and using that for the consume:
mService.getPurchaseHistory(version, packageName, "inapp", null, new Bundle());
Keep in mind the history contains the information of the last purchase of each of the product types from this user, so make sure to compare the product id's to the relevant one.
I encountered the same problem on some of my devices with a particular application that I already paid for and installed on another device. Clearing cache and force-stopping the Google Play store (and similar) applications on the phone did not help. What did help was to log-in on the Google Play store via Chrome on PC, and install the application from there, to any of my devices registered with Google Play. The Google Play on the phone side then showed the app "installing .. ". The app indeed was installed in minutes.

Test GMail marketplace app flow

So here I am again, exploring new Google platform and hunting down information and docs.
I'm trying to build a skeleton of a flow before I write any business logic code with actual use of the APIs, and as expected from Google, this process is excruciatingly painful.
I've tried to follow this doc:
https://developers.google.com/gsuite/marketplace/listing
Packaged the zip, put the flag DOMAIN_INSTALLABLE flag as was instructed in order for the app to be installible from the marketplace. In the dashboard of PRICING & DISTRIBUTION I've selected Private and added testers to the list of testers.
Now when I click View in Chrome Web Store (seen in image) it takes me to the extensions web store, and not to the marketplace store.
How can I get to the GSuite Marketplace flow, rather than the extension flow? Do I need to alter my manifest.json in some way that is not mentioned in the docs?
Thanks
it's true that the publishing flow is too complicated now. We are working on improvements and in the future everything will be in one place.
Unfortunately G Suite Marketplace does not support trusted testers (yet), that's why it doesn't show up.
What you might be able to do, is modify the url a bit after you clicked on 'View in Chrome Web Store'.
Just remove everything after the webstore id
I use this url:
https://chrome.google.com/webstore/detail/xxxxxx
xxxx should be your webstore id
You should be able to show your unlisted app in the Gsuite Marketplace, where you can initiate the install flow.
It works for me, but my test app

Selling custom product that doesn't fit well for in app purchase

I'am working on community project for chess players and I use standard in app purchases provided by Google to get credit for functions to be used. I prefer however one big payment for one country (culture) made by some company or major local chess entity, personally dealing conditions, creating data source to fit my app, giving users everything within the culture for free and in return giving the sponsor place in various screens of my application.
I know 3rd party payment processors are not allowed for standard app use.
Breaking Google Play developer policy in this case or not?
Making in app purchase for this is just weird.
How to get money for such a product not breaking Google play rules?
There's a whole website by Google explaining the policies.
I don't work for Google's policy team, and I'm not a lawyer, but here would be my reading:
If you want a user to pay within your app, then use Google's methods. So if you want the person sponsoring the whole country to pay within the App, use Google's payment methods.
What you do as a company to strike sponsorship deals and take payment is up to you, if that payment happens outside the app.
But you should read that website above carefully for yourself, and of course Google Play has the final say.

Identify test GooglePlay purchases

I have three different subscription purchases with different duration. I've configured test accounts and I can do test purchases. For those purchases Google doesn't charge me, but they look pretty much like real ones. When purchase is successfull, In-App Billing sends me some data about my purchase like packageName, productId, orderId, purchaseToken and so on.
In my handling code I need to know somehow if this purchase is real or not. In plain text: did I really earn money for it or was this purchase made by some test account and I earned for it nothing? I need this kind of info for purchases accounting.
So the question is: How do I distinguish between real and test subscription purchases in code?
Thanks.
P.S. I'm using Xamarin and C# for development.
You can make real purchase on a alpha/ beta version if your account is not added to licensed accounts list in your Google Play developer account.
Check this:
With alpha/beta test groups, real users (chosen by you) can install
your app from Google Play and test your in-app products. They can make
real purchases that result in actual charges to their accounts, using
any of their normal payment methods in Google Play to make purchases.
Note that if you include test license accounts in your alpha and beta
distribution groups, those users will only be able to make test
purchases.
UPDATE
To know which purchase is real and which is test one, check for orderId in response. No orderId will be assigned for test purchases.
Issue with Android IAP, no OrderID in Purchase Object
On the latest v3 Android Publisher API, you can obtain a SubscriptionPurchase object provided you have the Package name, SubscriptionId and the Token.
The SubscriptionPurchase object contains an optional (null-able) integer field named purchaseType. According to Google, when it is set and the value is 0, this is a Test subscription. I can confirm this works and matches the data I am getting back.
Here is the quote from Google's documentation:
// The type of purchase of the subscription. This field is only set if this purchase
// was not made using the standard in-app billing flow. Possible values are: 0.
// Test (i.e. purchased from a license testing account) 1. Promo (i.e. purchased
// using a promo code)

Can't link google play game services to an app because the client id is in use. However there is no app using that id

I'm trying yo update a game on google play to support leaderboards and achievements. (https://play.google.com/store/apps/details?id=com.rightpedalstudios.dragonseason)
However, when I go to link the app I get the message "This client ID is globally unique and is already in use."
I've searched online for people who have had the same problem and the advice they are given is to delete the client ID in the developer console, and if the app has been deleted there then undelete it first. However, there is nothing in the console using the ID, nor is there any deleted apps. As far as I can tell there is no app using the client id.
I did find another person asking a similar question here that was never answered.
Failing to create client ID, due to duplication of signing fingerprint by another Android OAuth2 client
I also get the message "The signing fingerprint you specified is already used by another Android OAuth2 client." When I try to set up a client ID from the developer console. (I know I'm not meant to do that if I'm using google play games, I just wanted to check if it failed from there too.)
I've tried contacting google support, I was directed to the google API support, and then directed here.
Two other developers that have worked on this project could have somehow created a client ID. Although I have contacted them and neither of them recall creating one.
Is there anyway to find out where this client ID is being used?
You have to delete the client id in the Google API console (now confusingly renamed the Google Developers Console !). Then you can link the app to the game straight away. I have just done this, and it worked fine for me. I wanted to link an existing app to a different game, so I deleted both the debug and prod(release) definitions and was able to immediately link the app to the new game.
Note that for many of us, doing work on Google Play Game Services in the Google API console is a last resort - many of us have encountered Google related bugs in the past by doing this !
This image may help:

Resources