I'm testing my in-app billing feature, but for some reason, I can't understand why I'm always getting an empty signature (inapp_signature field at bundle's extra) when com.android.vending.billing.PURCHASE_STATE_CHANGED is called.
According to the second row of this table I would be able to get a signed static response signature. Why does its not happening?
I've already set a test account in my developer account (I didn't published the app) and tried to obtain that signature with no success!
Does anyone have passed through this? Any help would be great. Thaks.
If you don't already have a published version of your APK that contains billing, then you will need to use a developer device. Ie one with same account as your developer console.
You also need to have the same version of the APK installed on your device as the one deployed to Google Play. In fact from memory, the latest APK deployed (not necessarily published) to Google Play needs to the one installed on your device.
And you nee to wait about an hour (it'll vary) from when you deploy to Google Play to when you are guaranteed that the GP instance of your phone can see the version deployed to GP.
Related
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)
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
I am very confused about this, both from the developer site and other similar questions.
I am trying to use V3 in-app billing. Seems to work with the static responses. Want to move on to testing with test purchases using license test accounts.
Basically - it is not working.
A signed app has been uploaded to the developer site (over 6 hours ago), and the app installed on the device, whilst not being signed with the same release key (it's a debug build and key), should work because Android Developers says "you only need to upload your application as a draft application. However, you must sign your application with your release key before you upload it as a draft application. Also, the version number of the uploaded application must match the version number of the application you load to your device for testing". Ie the code on the device apparently doesn't need the same key providing versionCode matches.
My developer console login is - say - a#googlemail.com, and I have a license test address registered (on the developer console) of b#gmail.com. The primary account on my phone is also a#googlemail.com. However I do have a secondary account on there of b#gmail.com. I do NOT want to have to reset my phone and change its one and only account to b#gmail.com.
Android Developers says "The only way to change the primary account on a device is to do a factory reset, making sure you log on with your primary account first" which seems to imply I might have to. It also then says "If the device has more than one account, the purchase will be made with the account that downloaded the app. If none of the accounts has downloaded the app, the purchase is made with the first account" which partially contradicts the first statement. Most of the text on the site appears to apply to pre-V3 code, OS 1.4 etc, so I am not sure how relevant it is.
I notice that Google Play allows me to select the account to use, and both the above show up in the list. Therefore, if I select that second (test) account in Google Play, should that be not sufficient to start testing with that test account?
What actually happens is, whatever account I have selected in Google Play, on starting a purchase I get a message "this version of the application is not configured for billing through Google Play".
Is this because I really do have reset the device and make the primary account b#gmail.com, or because of something else, possibly in the code?
I have some more information now, together with the answer above:
Once I loaded the device with the release signed key the message on a purchase attempt changed to "the publisher cannot purchase own item".
I tried logging in to Google Play with both my accounts and it made no difference. When logged in with the test account I also tried to find the app in the play store. Didn't show up even to the test account (draft app). (I hoped the test account could download it even as draft and therefore following the rules above about multiple accounts I could test purchase with the test account, but no).
Therefore I conclude:
Can only test on a device with an app signed with the same key as the one uploaded to the play store - whatever Android Developers might say.
The ONLY account that can test purchases on a device is the first set (primary) account.
Best therefore to have a completely new account as one's Developer Console account (bit late now).
Would be happy to hear if anyone can contradict the above.
Sign the app you upload to the device with a release key. As far as I know you can't test in-app billing without signing it properly. Actually, last week I tried it as written above and it works.
Hope it helps.
You can have multiple accounts on your devices -- as many as you want. But while testing the app, make sure you don't install it by the app Play Store on your device. Instead, go to Google Chrome, browse to its page on Google Play, and install the app from there. There's a button Install (or Installed).
I guess if you already install the app from account A, then the Android app Play Store will use that account to install next version (or reinstall current version) -- even though you're signed in as another account, like B for example.
However the Google Chrome will just install the app via the current signed in account. This could be a bug and it would be fixed some day. But it's working right now -- when I'm typing this answer. Android team is well known of being lazy for delivering fixes. I hope this "bug" will never be fixed :-)
I have an Android app that uses In-App-Billing to sell Account Managed Items.
I tested the app with the static response IDs and everything seems to work. I now want to test the app with real product Ids.
I created the app in the Google Play Store and uploaded a draft version of the app with the correct permissions. I now created an In-App-Billing item and published the item.
At the moment the app is unpublished. The item is created and published and I have a test account that is registered in the profile of the developer account and is the only account on the device that I use for testing. The app is signed with the same key as the uploaded draft. Edit:I'm testing with Android 4.1 && 4.03 at the moment
If I try to buy the item the Google Play Store pops up but shows a dialog with the following method: The item you requested is not available for purchase.
How can I test buying the item without publishing the app?
When you test the app, make sure you have exported and correctly signed it (not using debug key). Also make sure that you are using the correct Google account (registered test account) on the device.
Additionally, the registered test account cannot be the developer account.
Apart from this, it should work fine.
Note: Testing your own in-app purchases does require a valid credit card and actual payment.
And finally, it currently takes a few hours for market edits to propagate through the servers and show up.
It may take some time to reflect the changes on google play if you just uploaded the app and added the item there wait for some time near about 2 hr. it will be shown the item you want to purchase.
For others who reach this thread, Now it's not possible to test In-app billing with just a draft version of the app.
Draft Apps are No Longer Supported
Previously, you could publish a "draft" version of your app for testing. This functionality is no longer supported. Instead, there are two ways you can test how a pre-release app functions on the Google Play store:
You can publish an app to the alpha or beta distribution channels. This makes the app available on the Google Play store, but only to the testers you put on a "whitelist".
In a few cases, you can test Google Play functionality with an unpublished app. For example, you can test an unpublished app's in-app billing support by using static responses, special reserved product IDs that always return a specific result (like "purchased" or "refunded").
for details read https://developer.android.com/google/play/billing/billing_testing.html#billing-testing-test
You can test in-app billing by using options, look at this
Edit :
On the link I mentionned, you can see this :
Note: You do not need to publish your application to do end-to-end
testing. You only need to upload your application as a draft
application to perform end-to-end testing.
If you still can not test it, what you can do is to publish it and test it. If you think there might be bugs in your app's in-app billing, refunds are still a solution.
I'm thinking about something, on the dev site, you can see this :
Verify that your device is running a supported version of the Google
Play application or the MyApps application.
On what Android version are you testing on ?
You've to add the products(item sku) in you app product in your play store app account. The SKU you set In-App billine is not available. For testing, set the SKU androidtestpayment. Now you'll now get that error The item you requested is not available for purchase.
I've added licensing to my android application using LVL Library. Licensing works properly for normal users which buys it in Google Play (I think so - I don't have any feedback about problems). It worked also when I primarily tested it on second device with some test account.
Currently I have problem that server always return NOT_LICENSED response code (1) on devices with test account whatever I set in "license test answer" in developer console. When I test on device with publisher account answer is correct (server returns what I set in "license test answer").
I've tested on signed release build and on debug build and always the same. I've the same release build uploaded to Google Play (and use the same versionCode for debug version as this which was uploaded).
I've tested with single (primary??) test account configured on test device.
Interesting thing - to device with primary test account I've added publisher account (settings/accounts and synch/add account), and answer is still always NOT_LICENSED even if there is publisher account on it. Unfortunatelly I cannot delete test account from that device because I have some data which I don't want to delete.
I gave apk to other testers and added test accounts for them - they have the same issue - always NOT_LICENSED response.
i had the same issue for an app that was already published:
If you count up your android:versionCode in the Manifest, higher than the currently published version, the play store will always return not_licensed.
So the solution is to NOT count up the version code while you are testing.
The behaviour is strange but this solution worked for me.