Android Question In-App Purchase & android.test.purchased

luke2012

Well-Known Member
Licensed User
Longtime User
Hi to all,
I'm testing In-App purchase using "android.test.purchased" account.

I verified all the steps suggested in the tutorial but I got the following error :

Purchase signature verification FAILED for sku android.test.purchased
Signature verification failed for Product ID android.test.purchased (response: -1003:purchase signature verification failed)

Any Idea?
 

luke2012

Well-Known Member
Licensed User
Longtime User
Now I got the following response within the log :

Starting async operation: launchPurchaseFlow
Constructing buy intent for android.test.purchased, item type: inapp
Unable to buy item, Error response: 7:Item Already Owned
Unable to buy item (response: 7:Item Already Owned)

The only info that I got from _PurchaseCompleted event is the Success = false.
How to catch the error response code within the _PurchaseCompleted event ?
 
Upvote 0

luke2012

Well-Known Member
Licensed User
Longtime User
Check LastException. This error means that you have already purchased this item. You should call ConsumeProduct to remove it.

I called ConsumeProduct than I restart the purchase process and the result is the following :

1) In-App purchase UI says purchase OK.
2) The _PurchaseCompleted event report Success = false with the following error in log :

Purchase signature verification FAILED for sku android.test.purchased
Signature verification failed for Product ID android.test.purchased (response: -1003purchase signature verification failed)

After this if I ask a new purchase I got :

"Unable to buy item, Error response: 7:Item Already Owned"

So before I got a "Signature verification failed" in purchase process and than It seem Owned ?
I'm I little confused. :)
 
Last edited:
Upvote 0

shaxboz

Member
Licensed User
Longtime User
Hi! I also have like that problem!
I start the purchase process and the result is the following :

1) In-App purchase UI says purchase OK.
2) The _PurchaseCompleted event report Success = false with the following error in log :

Purchase signature verification FAILED for sku android.test.purchased
Signature verification failed for Product ID android.test.purchased (response: -1003purchase signature verification failed)
 
Upvote 0

luke2012

Well-Known Member
Licensed User
Longtime User
Try to test it with a real account and with real purchases. You can later cancel the orders.

Hi @Erel,
I test the in-app purchase flow with real accounts set as test account in the developer console.
My implementation seem to work fine also when user cancel the in-app purchase window (es. back key or touching the home screen).

The only problem is when the user press the home key while the in-app purchase window is open : the pause event is raised but the purchase flow still active.
When the user reopen the app a payment request is required and I got an error that say :
"Can't start async operation (launchPurchaseFlow) because another async operation(launchPurchaseFlow) is in progress."

So seem that the last payment flow still active also when the app is paused.
I think I have to catch the error or prevent it by cancel the payment flow (if active) when the "pause" event is raised. Right ?
 
Last edited:
Upvote 0

luke2012

Well-Known Member
Licensed User
Longtime User
When I press on the home button and then back to the app the dialog is still there. Are you doing anything special in Activity_Pause or Resume?

Nothing of special in Activity_Pause or Resume.
You tested the in-app dialog within the main activity ?
 
Upvote 0

luke2012

Well-Known Member
Licensed User
Longtime User
I'm implementing the in-app purchase using a class within a Activity x different from Main activity.
 
Upvote 0

luke2012

Well-Known Member
Licensed User
Longtime User
It shouldn't matter. It should still return to the last activity. Though I've seen cases where on some devices (or versions) it does return to the main activity.

Is this what you are seeing?

@Erel I have to test it to better and than I give you more details.
 
Upvote 0
Top