Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android billing v3 - no signature

What I want? After retrieving all purchased items I need to verify the purchase on my server, this I want to do with the signature and signed data received from the in-app payment.

First I used the in-app billing v2 there I got every time with my developer account a correct signature and signdata for the static test sku android.test.purchased.

I switched to the new billing v3 because it seems very nice to implement, however I get no signature any more.

I have uploaded a previous version of my APK to Google (don't published ever because it is not finished yet), also I added a active in-app product for further testings.

The upload of the APK was yesterday 10:00 pm so I think also I have waited enough.

What I tried? I have installed my application in different version:

  • unsigned apk with my self added "active" in-app product => no signature
  • unsigned apk with the sku android.test.purchased => no signature
  • signed apk with my self added "active" in-app product => no signature
  • signed apk with the sku android.test.purchased => no signature

Those 4 "app states" I tried both my developer phone (where my primary Google account is the same user as the developer console account) and with a test account on setup another phone, the test account is also placed in my account settings under "test accounts".

Hmm and now I have no more ideas how I get my signature. I think I will get the signature with an active app + active in-app product because the payment process works (The adb logcat displays that I purchased the "Android.test.purchased") My self created in-app product I could also not test because if I use my developer account, the play store tells me "can not buy, already owned" and with my test account I got an error "This product is not available for your account".

Do you have a solution for my problem?

like image 224
prdatur Avatar asked Dec 15 '12 14:12

prdatur


2 Answers

I found with V3 that the test products do not return any signed data, but if you sign your app with your release key and complete the purchase flow of your actual products that you do get signed data.

like image 177
Bryant Harris Avatar answered Oct 26 '22 11:10

Bryant Harris


You no longer get signatures for test purchases (android.test.*). I took the dive and uploaded my app to the market place (just didn't publish it) using my real products.

Low and behold signatures started to be returned! I recommend amending any server side validation you are using to skip the signature check when the data contains an android.test.* item id.

Note: The important bit about the above is: "using my real products".

like image 27
melodiouscode Avatar answered Oct 26 '22 11:10

melodiouscode