I’ve been getting emails from people who have been purchasing my in app from Google Play that it isn’t working. The in app purchase is for removing ads which does work with iOS so I know it’s not a code issue. I have also tested the Android versions with “android.test.purchased” and it works. I’m not sure if 100% of users are experiencing this problem but I have probably 10% contact me (or cancel purchase) that it didn’t remove the ads after purchasing. Is this a Google issue? It seems that the event.transaction.state == “purchased” isn’t always being returned. Thanks.
I’ve been getting emails from people who have been purchasing my in app from Google Play that it isn’t working. The in app purchase is for removing ads which does work with iOS so I know it’s not a code issue. I have also tested the Android versions with “android.test.purchased” and it works. I’m not sure if 100% of users are experiencing this problem but I have probably 10% contact me (or cancel purchase) that it didn’t remove the ads after purchasing. Is this a Google issue? It seems that the event.transaction.state == “purchased” isn’t always being returned. Thanks.
There is probably a Bug, with InApp for Android. Check this thread I created a few days ago: http://forums.coronalabs.com/topic/37536-android-in-app-purchase-possible-bug-eventtransactionproductidentifier-returning-wrong-productid/
event.transaction.productIdentifier() looks to be not working.
I did this to get the correct product ID after bought:
if(device.isAndroid) then
local jsonresponse=json.decode(event.transaction.receipt)
purchase_product_id=jsonresponse.orders[#jsonresponse.orders].productId
else
purchase_product_id=event.transaction.productIdentifier
end
Please try and test the Google IAP sample app to make sure it is showing the same behavior.
Please, provide me a link.
Most sample apps are included with the install of Corona SDK. If you are on Windows, go to your Program Files/Corona and you will find sample projects.
On a mac just look under applications/Corona and you will again find the sample projects.
I was going to try your code but I don’t think it will work for me.
if event.transaction.state == "purchased" then print("Transaction successful!") gameData.upgrade = "true" loadsave.saveTable(gameData, "data.json")
The above code isn’t the full code for the if statement. I only have one in-app purchase and so I don’t use product identifier to determine what they are purchasing. As long as they purchase it, it unlocks everything. It works fine with iOS but Android is having issues with some people not getting the “purchased” transaction state. I’m using the same transaction callback as the sample app so I’m not sure how to resolve this.
I’ve been getting emails from people who have been purchasing my in app from Google Play that it isn’t working. The in app purchase is for removing ads which does work with iOS so I know it’s not a code issue. I have also tested the Android versions with “android.test.purchased” and it works. I’m not sure if 100% of users are experiencing this problem but I have probably 10% contact me (or cancel purchase) that it didn’t remove the ads after purchasing. Is this a Google issue? It seems that the event.transaction.state == “purchased” isn’t always being returned. Thanks.
There is probably a Bug, with InApp for Android. Check this thread I created a few days ago: http://forums.coronalabs.com/topic/37536-android-in-app-purchase-possible-bug-eventtransactionproductidentifier-returning-wrong-productid/
event.transaction.productIdentifier() looks to be not working.
I did this to get the correct product ID after bought:
if(device.isAndroid) then
local jsonresponse=json.decode(event.transaction.receipt)
purchase_product_id=jsonresponse.orders[#jsonresponse.orders].productId
else
purchase_product_id=event.transaction.productIdentifier
end
Please try and test the Google IAP sample app to make sure it is showing the same behavior.
Please, provide me a link.
Most sample apps are included with the install of Corona SDK. If you are on Windows, go to your Program Files/Corona and you will find sample projects.
On a mac just look under applications/Corona and you will again find the sample projects.
I was going to try your code but I don’t think it will work for me.
if event.transaction.state == "purchased" then print("Transaction successful!") gameData.upgrade = "true" loadsave.saveTable(gameData, "data.json")
The above code isn’t the full code for the if statement. I only have one in-app purchase and so I don’t use product identifier to determine what they are purchasing. As long as they purchase it, it unlocks everything. It works fine with iOS but Android is having issues with some people not getting the “purchased” transaction state. I’m using the same transaction callback as the sample app so I’m not sure how to resolve this.