What should be the "productIdentifiers"?

I am trying to setup Google Play InApp Purchase.

I setup 2 “In-app products” -> “Subscriptions” on google play as below. And there is no error message on google play and I can release the app without issue.

ID: monthly

Name: Monthly Subscription

ID: yearly

Name: Yearly Subscription

However, when I tried the following code. It always return me “Number of products: 0”

local function onLoadProducts(event) alert('Number of products: '..#event.products) for i = 1,#event.products do alert('productIdentifier: '..event.products[i].productIdentifier) alert('title: '..event.products[i].title) alert('description: '..event.products[i].description) alert('localizedPrice: '..event.products[i].localizedPrice) end end store.loadProducts( {"monthly", "yearly"}, onLoadProducts ) 

I tried to replace the product identifier to “com.domain.myapp.monthly”. It has the same result.

I tried to get the value of “store.isActive” and “store.canLoadProducts”. They both return true. I have added the License key to config.lua and added the setting and permission to build.settings as well. I also testing the inapp purchase by using the “Internal Test” build from google play.

I am not sure if I am setting the right product identifier or not. Or anything I have missed? Can someone help?

Thanks,

Alex

I think I found the solution in this post:

https://forums.coronalabs.com/topic/72216-google-iap-product-details-for-subscription-is-not-showing-up-need-little-info/

However, as what he said, I can get the subscription list, make a purchase, but I am not able to get any callback! The last reply on that post was in May, 2018. And I am using the latest corona sdk 2018.3452 (2018.12.14). Is this fixed? or do I miss anything?

Are you trying the undocumented store.purchaseSubscription(subscriptionID) call? The last two posts indicate that seems to work.

Rob

yes. I am using store.purchaseSubscription(‘subscriptionID’). It can bring up the purchase dialog but I am not able to get any callback in store.init()

I think I found the solution in this post:

https://forums.coronalabs.com/topic/72216-google-iap-product-details-for-subscription-is-not-showing-up-need-little-info/

However, as what he said, I can get the subscription list, make a purchase, but I am not able to get any callback! The last reply on that post was in May, 2018. And I am using the latest corona sdk 2018.3452 (2018.12.14). Is this fixed? or do I miss anything?

Are you trying the undocumented store.purchaseSubscription(subscriptionID) call? The last two posts indicate that seems to work.

Rob

yes. I am using store.purchaseSubscription(‘subscriptionID’). It can bring up the purchase dialog but I am not able to get any callback in store.init()