Android In-App Billing or Sandbox - android

I have a problem related to In-app billing v3 (Sandbox). I've uploaded the application and defined gmail accounts for testing and create In-app product with specific Product Id: light_armor and ACTIVATE the product items. When I tried the sample application given (attached) together with the "Google Play Billing Library" which is located in "C:\Program Files\Android\android-sdk\extras\google\play_billing" or downloaded into Android SDK manager Which is the name of the sample app there is TRIVAL DRIVE.
When using the reserved product Id e.g "android.test.purchased" and other 3 reserved product id's. It works properly but when I tried to implement the Product Id that I've created where the status is ACTIVE it gives the error of "This version of the application is not configured for billing through Google Play. Check the help center for more information."
I have waited more than 24 hours to see if it's really worked well but it give me this error. I assume that google gives the exact example of In-app billing.
Questions:
Does google play testing purchase affect by the type of carrier you have?
Does the app really need to be published in order to test the In-app product items?
I've declared the product Id as light_armor only, does it necessary to include the package name on it? like com.example.inappbilling.light_armor.
Sorry for my Bad english.. I hope you would help me. Thank you . ^_^

Answers:
May be not, i don't find anything about anywhere saying in app purchase carrier dependent.
App doesn't need to be published for testing in app purchase, only items needed to be active.
You only set the product id as your wish by following convention. It will be automatically reflected as com.example.test:item.
In-app Product ID
Product IDs are unique across an application's namespace. A product ID must start with a lowercase letter or a number, and must be composed using only lowercase letters (a-z), numbers (0-9), underlines (_), and dots (.). The product ID "android.test" is reserved, as are all product IDs that start with "android.test."
In addition, you cannot modify an item's product ID after it is created, and you cannot reuse a product ID.
These are the procedure for adding and testing in app purchase which works in my case --
First You have to create a signed apk then uploade it to play store and save as draft. Remember what product id you used in your code as item product id, you will need this next step.
Second Add a new product in In-app Products, set the product id of this item according to that id which you added in code and set it to Active.
Third Add the tester account in developer console and distribute this signed apk to those people for testing. If you don't distribute that signed apk then you will always get
"This version of the application is not configured for billing through Google Play. Check the help center for more information."
error as the app by which you are trying to test the in app purchase doesn't contain the same finger print which is in developer console.

Related

Cannot Testing with Static Responses

I'm trying to implement an InAppBilling in my Android app.
I'm almost there, but there is still one part missing.
I've followed the documentation (http://developer.android.com/google/play/billing/billing_integrate.html#Subs) and replicate the logic used in the sample app provided by Google.
I have this application published in alpha mode, with one test account and an integrated product (subscription) created.
String payload = "";
mHelper.launchPurchaseFlow(Settings.this, SKU_PREMIUM, IabHelper.ITEM_TYPE_SUBS,null, 1000, mPurchaseFinishedListener, payload);
If SKU_PREMIUM variable is the real product id defined in google console, everything is fine. I windows appears in my application telling me to buy the subscription, and its price. However, given that I do not have a visa card associated to my test account, I cannot proceed. Thus, I'm trying to use Static Responses.
However, if I change SKU_PREMIUM to "android.test.purchased", I'm given an error saying The item you requested is not available for purchase..
And even if I change reserved code to android.test.canceled, android.test.refuned or android.test.item_unavailable the outcome is the same.
What am I missing here?
Thanks!
The problem is that you cannot use reserved product ids on subscription testing. They are only suitable for "normal" purchases. For subscriptions you to use the right subscription id defined by you in google play settings page. You should:
Upload an apk to store (it can be in alfa or beta testing);
Be the application tester (the email should be different from the developer email);
Have a credit card associated to your test account.
If you have this setup, you won't be charged by Google. Note that in-app subscriptions auto-renew every 24h.
As far as I know, there is no easy way to test the android in-app billing. You really have to follow theses steps.

In app purchase not working: item not available for purchase

Using in app purchase in my application. I have double checked the products are listed at playstore and in active states. plus the application is published but in beta testing. product ids using in my code is very same as in playstore. I'm testing the signed apk on phone.
Problem: whenever i click the button and try to get product it endup like this.
please help. thanks
Step you need to follow, once launches an inapp products in your application.
You have latest In-app Billing Version configured in application
Apk is in published state but in beta testing or any other testing
List the products with unique ids at play store panel
Change the state of products to active state
Product ids are same in source code as well in play store (double check)
You have signed apk installed in phone
versionCode of published apk & testing apk must be same
you have added a tester at play store under same apk
You need to test inapp from very same email, you have added at google play store (as tester)
once i followed all steps this error is gone. In my case it is because of tester's email :)
You have to use a different (test) account than the one you're signed in to the developer console with, and add it in the developer console.
Edit: see here: the item you requested is not available for purchase
I think, you might miss something but to get the missing part, you must share your code of InApp Billing section. By the way, you can also use the library project from https://github.com/anjlab/android-inapp-billing-v3.
Possibly a caching problem with Google Play services. Clear out the cache and try again.

Android In-App billing error

I have followed google instructions for implementing in-app purchases service.
I was provided access to Google Play developer console as invited user. I took private key from it, and added my google account to the input field with test accounts. After that I created APK file and signed it with valid certificate. Then uploaded application to Google Play but didn't publish it. After it I created needed in-app purchases and published them. Then installed same signed apk file on my device.
Right after publishing in-app purchases and for some period of time my application was giving me message like "not found", but some time later it became available. And now I can buy all the items from the application, but no one else who installed the same APK file can't. I tried to add their email addresses into list of test accounts in profile - no luck, even the user owner of the Google Play account can't buy anything. They keep receiving something like "item you selected is not available for purchase" When they try to buy test purchase item (the one that is described in documentation) they can successfuly get "android.test.purchased: PURCHASED"
Google Play takes a pretty long time to update its servers. When I was implementing in app billing the first time, I must have rewritten everything at least 50 times. Nothing changed, except some 12 hours later it all started working magically. Most likely their server hasn't updated yet. If you can use the test items correctly, then your implementation is likely fine, and you just need to wait for the servers to update.
Only the signed apk file that you uploaded in play store can be used to buy the in app product.
Did you give the in app id in the signed apk file before registering the in app id in play store.then only others can buy the item.
as per the edit
see you have use android.test.purchase ri8 it is an test id when your make your app real your need to replace that with your own in-app id.Then you have a question how to obtain in-app id.its very simple after saving your app(not published) in draft there is an option to add the in app product for your app.click that option where you will see the app id in one of the field then fill the in app id and also set corresponding amount for your product and publish the in-app product not the app.Replace the android.test.purchase with your new id in the signed apk and wait for some time so that the server can update your changes.

how to list out items from android market for in app purchase

I am making an Android app based on in app purchase. In my app I have a sample video and if a user wants to buy it, I want to make an in app purchase through Android Market site.
I went through the steps in Downloading the Sample Application.
I downloaded the sample app and I tried to use it for checking purpose. I added my public key of my market account and added the video name I have to show to the user. In my market account, in the in app product list I added the details of my video title, description, product id.
In the developer site I found the following line:
Do not publish the sample application; leave it as an unpublished draft application.
The sample application is for demonstration purposes only and should not be made publicly available on Android Market.
When I run the app and click the buy button an alert box gets appeared saying that
"The Item that you requested is not available for purchase".
The Android documentation is quite confusing on this point.
Yes, leave the APK as draft--do not publish it.
Make sure the email address attached to your device is entered in the "Test Accounts" field (separate multiple email addresses with commas): https://market.android.com/publish/editProfile
However, when you add an in-app purchase product to the app, you need to click the publish button ON THAT PRODUCT. The app is not published, but the product is.
If you do this, then you should be able to run the app on your device, view the IAP products and purchase one, but other people would not be able to, if their email address was not listed in the Test Accounts for your developer profile.
at last i found my mistake with the help of a sample app. The in app product id which is given in the market account must be given in two places of the app. In the
CatalogEntry[] CATALOG and in the strings.xml file the ids entered must be the same. i have given the same id in Catalog entry but not in the strings.xml file
now the in app products gets listed out correctly.

Android in-app purchase - RESULT_ITEM_UNAVAILABLE

I'm trying to integrate Android Market in-app purchases into my app, but unfortunately coming across an annoying error every time I try to purchase a test product.
I've taken the sample application (Dungeons) and added it to my app. I've updated the Public Key and also updated the list of products to the following:
/** An array of product list entries for the products that can be purchased. */
private static final CatalogEntry[] CATALOG = new CatalogEntry[] {
new CatalogEntry("lemonstorm.huru.full", "Full v", Managed.MANAGED),
new CatalogEntry("android.test.purchased", "purchased",Managed.UNMANAGED),
new CatalogEntry("android.test.canceled", "cancelled",Managed.UNMANAGED),
new CatalogEntry("android.test.refunded", "Refunded",Managed.UNMANAGED),
new CatalogEntry("android.test.item_unavailable", "unavailable",Managed.UNMANAGED)
};
I've exported the application using Eclipse, and installed it on my phone and also uploaded it to the Android Market website. Also on the Android Market website I've added lemonstorm.huru.full as an in-app purchase and published it.
I've also added my googlemail account as a testing account (that is the one I'm signed into on my phone).
When I run the application on my phone I get a RESULT_ITEM_UNAVAILABLE message whenever I try to buy lemonstorm.huru.full, but if I try for example, android.test.purchased, it works absolutely fine.
The documentation for RESULT_ITEM_UNAVAILABLE states the following:
Indicates that Android Market cannot find the requested item in the application's product list. This can happen if the product ID is misspelled in your REQUEST_PURCHASE request or if an item is unpublished in the application's product list.
The product ID is definetely the same, it's definetely published and the request must be going through ok as it's the sample application and it worked for android.test.purchased
Any thoughts would be appreciated!
I had this same problem. After I published the application, the products were found. Looks like a bug in Google's test accounts(?)
I've had the same issue. I was playing with Dungeons sample and missed that sword_001 and potion_001 products must be "Published". The problem for me was that they where just saved and remained "Unpublished".
To solve it I've just edited products and pressed Publish button for both. Now I can buy both from the sample app.
I got BillingClient.BillingResponse#ITEM_UNAVAILABLE response and this message from Play Billing Library:
ProxyBillingActivity: Got purchases updated result with resultCode 0 and billing's responseCode: 4
It turns out, I forgot to visit the opt-in link for testing (I only added the tester to list of alpha testers and to the list of users with license testing access).
As far as I know:
Does the version code the same with unpublished draft application in your application publish site?
Did you Touch Factory data reset to test account?
Did you set managed product of your lemonstorm.huru.full in publish site?
Here is a great rundown for how to test in-app billing, it includes a chart for what you can expect to see from the market app in situations where an app is published vs. non published and using a user that is a test user, developer, or other:
http://developer.android.com/guide/market/billing/billing_testing.html
Also, remember to sign the app when you export it.

Categories

Resources