Android IAB v3 testing and building - android

I'm implementing IAB v3 into my application and I have done following steps:
Published signed APK into Alpha testing and added a test purchase product
Created a Google group which are allowed to be testers and added a test account into the group
Accepted to be a tester in my device
Took example code from TrivialDrive example into my application
IabHelper setup is OK but says there are no SKUs.
So now I'm trying to figure out that with what package can the IAB feature be developed further. The documentation says that the package must be the Google Play version, someone say that you can build signed package all over but must use same keystore for signing the package.
Isn't there a fast to to just launch the application with Eclipse Run As Android Application, so I can see logs and use debug mode if I want?
Thanks.
EDIT
Looks like the purchases can be done with simply launching the app with Eclipse, not sure if the debug keystore which I made from my release keystore has affect on this. The SKU ids must be hard coded in the client/own server so I misunderstood the IabHelper query part.

Here is sample sku id for testing inApp purchase.
static final String ITEM_SKU = "android.test.purchased";
Here is good tutorial.
http://www.techotopia.com/index.php/Integrating_Google_Play_In-app_Billing_into_an_Android_Application_%E2%80%93_A_Tutorial

Related

Product state is always "invalid" (using Cordova Plugin Purchase)

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.

Android In-App Billing please sign in to Google account error

I integrated Google IAP Billing to an Android application.
I published my application in Alpha version on Google Play Store. I copied the public key that I added in my project on Android Studio. So, I use the good Public API Key with my IabHelper instance.
I signed an APK that I use on a device with an unique account that is different from my developer account. This account is added in the license testing emails field on the Settings part of Google Play Developer Console.
I also checked the SKU ID of the item I want to purchase is the same on my application and on the application signed.
When I launch the buy process, I get a dialog with Please sign in to your google account error. But, I am already connected because I can go on Play Store application and download apps. I also tried to clear cache data for Play Store app and Google Play Services but nothing works for me.
I must mention that on the manage list of alpha testers, I have created a google+ community like asked but there is no link to send to my alpha-testers to opt-in.
Someone has an idea about the problem ? And the solution to solve it ?
The alpha tester has to satisfy these two conditions:
joined the alpha testing community
opted-in for alpha tests
Firs you have to invite the tester to the alpha testing community. Second the alpha tester have to opt-in using this URL: https://play.google.com/apps/testing/your.package.name
It just takes time. Give it couple of hours and it will work.
Also make sure that the file you are running on your phone is signed with the sane certificate that is uploaded on google play (not debug file)

Invalid Product error from Google Play

I'm attempting to get https://github.com/j3k0/cordova-plugin-purchase working for Cordova/PhoneGap and I'm getting an "Invalid" error when I try to retrieve the product info.
I don't know what I'm doing wrong, but here is what I have done:
The plug-in is installed with the proper billing API key in platforms\android\res\values\billing_key.xml
The store.ready() event does fire without errors, so I know I'm at least connecting.
I've uploaded a signed APK to Beta and published it.
I created an in-app purchase and confirmed it is active.
I confirmed I'm calling the right product ID within the code by hard-coding the ID.
I get callbacks from store.when("product").updated(fnProcessProduct), but the product.state is always store.INVALID
Is there something I'm missing, either within Google Play, PhoneGap, deploying, or the plug-in?
Got the answer - once you upload an APK to Google Play as beta and activate your IAP product, you must test using APKs signed with the same key. I was using Ionic, and Ionic was signing with a debug key.
More info: https://github.com/j3k0/cordova-plugin-purchase/issues/75

In-app billing of sample application is failing with payment error

Executed the following steps for running the sample application, but the application is failing with payment error.
Downloaded the sample application from android SDK
Added Google Play public key to the sample application code.
Changed the package name of the sample application.
Built the sample application in release mode and sign it.
Created a product list for the sample application.
Published the items of product list (sword_001 and potion_001) for the draft version of sample application.
Test account registered under the Google Play publisher account.
Verified that device is running a supported version of the Google Play application.
Installed the same signed application onto the device.
10.My test account is the primary account on my device.
11.Ran the application and purchased the sword.
When I try to do a purchase getting the following error while the order is being authorized ('authorize payment' is displayed), this usually happens about 30 seconds after the order has been placed (i.e. 'accept & buy' has been tapped).
"Your payment could not be processed. sign in to your google wallet account to request support"
Does anyone experiencing the same error ?
Thanks in advance.
Getting in-app billing is challenging. Its not easy to read thru and get it integrated. I have a project created which works like a hello world, I suggest you download and use that. There are just too many variables. I have documented the integration steps here.
Problem got fixed when I changed the API version number inside makeRequestBundle() method of BillingService.Java:
request.putInt(Consts.BILLING_REQUEST_API_VERSION, 1);
to
request.putInt(Consts.BILLING_REQUEST_API_VERSION, 2);

InAppBilling Issue

When I implement InAppBilling, the Following screen appears.. I used this link
http://blog.blundell-apps.com/simple-inapp-billing-payment/
for implementing InAppBilling
so where am I wrong?
Most likely you are using a version of the app that is signed with your debug key or you are trying to purchase using your developer account which is not allowed.
You should also have uploaded an apk to Play store that has the billing permissions (although you do not need to publish it)
You need to sign your apk with your release key. Trying to purchase in debug mode will not work.
See this link for full testing instructions.
http://developer.android.com/guide/google/play/billing/billing_testing.html
May be you are running this app from eclipse directly.
Whenever you are using In-App purchase in your app.
Export signed APK then try out this...

Categories

Resources