Android In App Purchases not working?

Hello,

i’m trying to implement the Android In-App purchases for my app, but somehow strange things are happening :slight_smile:
I have looked in the forum to find a solution to this strange behaviors, but what I found didn’t answer some of my questions, so I will explain here and hope you have encountered some of the same problems and maybe have a solution for them :wink: … here we go:

The Google Play testproduct “android.test.purchased” is called with store.puchase which brings me successfully to Google Play where I can click the testuser fake pay-button.

  1. But where can I see the price for the In App Purchase? What about localizations and countries? I can enter the price at Google Play for my real product, but where is it shown in the app? How can I handle this? How can someone in another country see “his” price of my product automatically?

  2. When I click the fake buy button I get the Google Play message the product was bought successfully and then get moved back inside the app… but there I don’t get the transaction info via the function transactionCallback = function (event). The code in ‘if ecent.transaction.state == “purchased” then’ is never reached. I guess I don’t get any transactionCallback at all. So how can I work around this? How do you guys do it? How to handle purchases and refunds then?

  3. Any tips from developers with working Corona build Android In App purchase systems are welcome! :slight_smile:

Thank you for your help!

Have a nice weekend!

Daniela
[import]uid: 137572 topic_id: 35339 reply_id: 335339[/import]

  1. You can’t get pricing info for Android the same way as iOS (yet).
    Which means you’ll just have to have a “Buy” button with no price on it, or a button with a fixed price on it. The user will see the real price and currency when taken to the Google Play store of the country they’re in. I said “yet” above because Google has started to implement a way to get pricing info, however that’s not available yet.

  2. You should be getting a ‘purchased’ event.
    Have you done a appstore.init("google", transactionCallback);? [import]uid: 70847 topic_id: 35339 reply_id: 140537[/import]

  1. You can’t get pricing info for Android the same way as iOS (yet).
    Which means you’ll just have to have a “Buy” button with no price on it, or a button with a fixed price on it. The user will see the real price and currency when taken to the Google Play store of the country they’re in. I said “yet” above because Google has started to implement a way to get pricing info, however that’s not available yet.

  2. You should be getting a ‘purchased’ event.
    Have you done a appstore.init("google", transactionCallback);? [import]uid: 70847 topic_id: 35339 reply_id: 140537[/import]

Thank you! Sorry for the late answer, but I was so frustrated I just picked up where I left in January :slight_smile:

I did all this you’ve described, but it looks like I can’t get into the “purchased” event with google.

Is it possible maybe because the store.loadProducts() function (which is only working for iOS) is the reason for the problem…? Let me explain: I have to use:

validProducts[1] = {}                             validProducts[1].title = "add title here"                             validProducts[1].description = "add text here"                             if currentProductList then                                     validProducts[1].productIdentifier = currentProductList[1] -- which is the product ID                             end  

Can it be maybe I used the right productIdentifier (productID) I have created with Google, but different title or description? Means, maybe the title in the code was different like the one I created with google?

Hi there,

I don’t think the title or description you use in your code has any relationship to the title or description in Google.  If they’re different, that wouldn’t affect the purchase flow.

To debug this, I think it would be helpful if you posted your code (a) where you call store.init(), (b) where you call store.purchase(), and © your transaction callback function.  With all three of those posted, we should be able to figure out what’s going wrong.

Meantime, does your IAP flow work completely fine on iOS?

  • Andrew

Thank you for your fast reply.

My iOS upset is working fine and I just could manage a successfull test for the Android purchase… but I can’t tell why it worked now. My guess is maybe I didn’t wait long enough with the tests before? Let me explain:

with my NOT working tests I bought the game (the google play window in the center of the screen confirmed the successfull transaction!) and my app got stuck in the store screen, which means it didn’t get out of the transaction callback function and it didn’t access the purchase event. But maybe it just took too long which also is bad, but is far from not working. I tried a test withoug changing anything on the code and now it worked fast and like I know it from iOS.

Anyone here who has made similar experiences maybe?

I’m still afraid the long wait can be creating a lot of negative feedback from users if this is happening to them.

Thank you! Sorry for the late answer, but I was so frustrated I just picked up where I left in January :slight_smile:

I did all this you’ve described, but it looks like I can’t get into the “purchased” event with google.

Is it possible maybe because the store.loadProducts() function (which is only working for iOS) is the reason for the problem…? Let me explain: I have to use:

validProducts[1] = {}                             validProducts[1].title = "add title here"                             validProducts[1].description = "add text here"                             if currentProductList then                                     validProducts[1].productIdentifier = currentProductList[1] -- which is the product ID                             end  

Can it be maybe I used the right productIdentifier (productID) I have created with Google, but different title or description? Means, maybe the title in the code was different like the one I created with google?

Hi there,

I don’t think the title or description you use in your code has any relationship to the title or description in Google.  If they’re different, that wouldn’t affect the purchase flow.

To debug this, I think it would be helpful if you posted your code (a) where you call store.init(), (b) where you call store.purchase(), and © your transaction callback function.  With all three of those posted, we should be able to figure out what’s going wrong.

Meantime, does your IAP flow work completely fine on iOS?

  • Andrew

Thank you for your fast reply.

My iOS upset is working fine and I just could manage a successfull test for the Android purchase… but I can’t tell why it worked now. My guess is maybe I didn’t wait long enough with the tests before? Let me explain:

with my NOT working tests I bought the game (the google play window in the center of the screen confirmed the successfull transaction!) and my app got stuck in the store screen, which means it didn’t get out of the transaction callback function and it didn’t access the purchase event. But maybe it just took too long which also is bad, but is far from not working. I tried a test withoug changing anything on the code and now it worked fast and like I know it from iOS.

Anyone here who has made similar experiences maybe?

I’m still afraid the long wait can be creating a lot of negative feedback from users if this is happening to them.