Google's documentation states that you should upload a 'draft' APK and add your In-App Products to that - you will then to able to test with your developer and other linked 'test' accounts - that's what it says...
It also says you need to use the 'new' Developer Console to add products for v3 of the billing API - but uploading an APK with the new console instantly publishes it!!! - WTG there Google!!!!!
You cannot unpublish an APK/revert to an earlier one either - the 'live' versions is now the test version - BEWARE of this nonsense!!
So you re-upload the old version to fix that and then try to figure-out how to upload a 'draft' APK. Switching to the old console, you can upload and not 'Activate' an APK - however this doesn't get marked as 'draft' so I'm not sure that's what they mean!?
You can add your In-APp products to that, but running that APK on a device/attempting to purchase anything, results in a message saying the 'current version of this application is not configured for In-App Billing'...
At this point you realise you're going around in circles with a company who's documentation is a lot of nonsense so you resort to this place for help! - please? :)
Someone must have managed to get this to work - would they care to share the EXACT steps for getting a new APK uploaded as 'Draft' with In-App Products which can actually be purchased (for testing purposes) please?
I'm off to swear a lot on the Google forums now :)
1) Take any version of your code and add the following permission to it:
<uses-permission android:name="com.android.vending.BILLING" />
Having the rest of the billing implementation is completely optional in this apk.
2) Export it and sign the apk with your signing certificate, and make sure you incremented the version code.
3) Upload the apk to Google Play using the old version of the Developer Console, but do not activate it.
You're done. You should now be able to add in app products now. You can now add the rest of the billing code to your app and debug it on the device as usual, and create products in the online interface. It may take a few hours (upto 24) for any products you create to be accessible in your app.
The whole thing is quite confusing, but uploading an APK in the new console doesn't publish it right away, at least not for new applications. It should go into a 'Ready to publish' state and doesn't go live until you change to 'Publish this app' (which is itself confusing because one of the 'states' is a state, while the other is an 'action').
Related
I am trying to get a list of Android In App Billings (IAB) in my app--subscriptions specifically. While debugging on device (NOT EMULATOR) When it makes the call to get the products I get this error error occurred while loading products: Error: IAP not prepared. Check if Google Play service is available. Here are the things that I've done:
The apk is uploaded to the Google Play Console as an alpha release.
Hours (days!) have passed and the release is available (I can see it in Play Store).
I added the in app purchases in the Google Play Console.
I added a gmail account as a tester in the Google Play Console in both the general settings area and the list of testers for a release.
I installed the apk that has the same version number AND version name as the apk that is in alpha in Play Store
I am using a real device (not an emulator)
I am signed in as the tester email account.
My AndroidManifest.xml has the BILLING property set
It should be noted that I am using react-native and this package for in app billing https://github.com/dooboolab/react-native-iap although I think the issue here is I have missed one of the general steps necessary to set up in app billings for Android. Any ideas or guidance would be appreciated--I've been fighting this for days now!
Can you please provide code you are using?
According to this issue answer: https://github.com/dooboolab/react-native-iap/issues/301 please make sure you are initializing IAB using initConnection not prepare.
I'm using Cordova Plugin Purchase to use in-app billing in my Android app. However, using the alert with the JSON-stringified product, the product's state is always "invalid". Here is a sample of my code around this issue:
store.register({
id: 'test_walker_01',
alias: 'walker',
type: store.CONSUMABLE
});
item_walker = store.get("test_walker_01");
store.when("product").updated(function (product) {
alert(JSON.stringify(product));
});
store.refresh();
My problem: I cannot access my product's information from Google Play.
After much searching on Google and Stack Overflow, here are the steps I already did/verified to find a solution:
I triple checked that the ID is the same than on Developer Console, and the type is "managed".
The product is activated in Developer Console.
I uploaded the exact same APK on my test phone than uploaded in the Developer Console, in Alpha testing.
I'm using a different Google account than the one in the Developer Console.
I have added this (different) account in the list of authorized test Gmail accounts.
The APK that I am signing and uploading is the release (not debug) version.
As far as I know, I am only using one key to sign all my APKs (referring to this SO question). I'm unsure how using many keys could happen.
I even uninstalled the app completely, rebooted my phone and reinstalled it.
Thank you for your help!
After much searching, I found my answer in the last few comments in this issue on the Plugin's Github: You have to publish your application (in Alpha mode) on Google Play for it to actually work.
Publishing in Alpha mode only lets people in your test group access the application, so no worries about it being public. Just fill the mandatory fields with temporary information.
We have an existing app (apk v282) published in Google Play. This app doesn't have in-app products and no BILLING permission.
We have developed an upgrade version (v292) that contains in-app products and BILLING permission.
We face a problem to create the in-app products in Google Play console:
When we upload the v292 apk as a draft in Google Play console, we have two APK listed in the draft: the old and the new:
From this page, we have two alternatives:
1- Either we click on "In-app products" on the left list to create our products, we see a page saying:
To add in-app products, you need to add the BILLING permission to your
APK.
So we cannot create in-app products, probably because v282 still is in draft configuration.
2- Or, we remove the older v282 APK (that hadnt the BILLING permission), in order to leave only the new v292 in the Draft configuration. But then when clicking on "In-app products", we get a popup warning about the configuration not being saved. But there is no button to save it, only publish. Of course we don't want to publish it as it's under test.
To sum it all up: How to test in-app purchase in an application that was previously published without it?
For everyone looking for a solution to this: uploading an apk to alpha will do. So you should add billing permission to your android manifest, build a signed version and load apk to alpha. Afterwards you can configure in app purchase products without uploading an apk to production.
I had the exact same problem. What I ended up doing was uploading a new release with the new permission but without the in app billing option visible. Mine was easy as it was just a preference option to remove ads that was easy to just not show. Once published the site let me create in-app products and I was able to test with a new apk file and published that one shortly afterwards.
You have to temporary change the package name and upload new application in market (Do not need to publish ) for temporary.
Just checking in App purchase so don't choose any package name which you want to use in feature. because Each package name is unique and Google remembers all package names anyway so you could use this a reminder
And then test in that and when you get success full run in that temporary build app then you can change again your previously package name in which you want to upload your next apk and you must have to delete your old version from that and then you can create in app product now.
Now if you want to check in App purchase then you have to buy that product from different account except this account in which you are uploading your apk Dont worry you can rollback your money after checking this functionality.
I recently face this problem and I followed like this So I hope you will get some help from my experience.
I think the issue here is that the Google Play console thinks that you are trying to publish multiple apks. This is only supported if the apks are targeting different device configurations:
publishing multiple apks
I think that once you delete the previous version you will be able to activate the newer version with in-app billing. I'll be trying this out shortly and update this answer if I learn more.
I am trying to test subscriptions in android app. I use dungeons example. I uploaded apk which is not published, but subscription items are published. I added new test account(gmail) in dev console which is not developer account. I reseted phone to factory and added test account. I installed signed apk(same version as uploaded).
When I try purchase I get "The item you have requested is not available for purchase" but I see in background item which I requested.
Some thoughts what can be problem here? Thanks
Same thing happened to me when I tested in-app billing, and there was no other way to overcome it but to actually publish the application. Once the application had "replicated" to Google servers (which took several hours, during which I got yet another obscure error message when trying to purchase anything), buying subscriptions worked fine.
use this link and refer table 1. I also faced this problem.http://developer.android.com/guide/google/play/billing/billing_testing.html#billing-testing-static
Have a look at that table than u will get that whats going wrong in your table.
I had the same problem. After changing the APK state from unpublished to Activate (in APK files tab) and waiting for 1 hour or so, the product ID could be purchased.
Make sure to upload the signed APK to developer console.
Make sure to install the signed APK on your device not launch the app in the debugger.
Make sure to create a test account in your developer console.
Make sure to sign in your device with your test account.
Make sure to create in app billing in your developer console and finally activate the item from the console!!! (this is the one that got me after fully following google's tutorial)
I set up test users so that I can test that in-app billing works, but I am a bit confused by the process.
I am following the android developer billing test guide here: http://developer.android.com/guide/google/play/billing/billing_testing.html
It has a few confusing points. It says not to publish your app, but somehow I need to get the app on my phone. So how can I get an un-published app on my phone?
Also, am I supposed to make an area on the app with the 4 product ids that google reserves and try to buy those, and then once I see it works, just get rid of those buttons to buy those test products? Is that how this is meant to be done?
Thanks!!
It says not to publish your app, but somehow I need to get the app on
my phone. So how can I get an un-published app on my phone?
There's no need to publish your app to get it installed. Create a signed build (See http://developer.android.com/tools/publishing/app-signing.html). Then install it on your phone using adb install <apk name> The SAME build you must upload to your playstore dashboard. After uploading, you will see 2 options:
PUBLISH
SAVE
Click on 'SAVE'. After saving your uploaded app, you will be able to add InApp products for that app. You MUST save and publish your inapp products in order to test them.
You should upload the apk to your developer account and fill in the mandatory fields and save it without publishing it and then you can create in-app products for the application and publish it. please note that the in-app products must be published before testing billing. But you don't require to publish the application to test billing.
Try the MoVend library for Android. it supports google play in-app billing, paypal and many more.
http://www.movend.com/
How to sign an android apk file
To install it you can use adb or you can send this file by mail. Then download in the device and install it.
Check that Settings > Applications > Unknown sources is checked in the Device.
If you are having problems implementing in-app purchase I recommend you the library AndroidBillingLibrary.