Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

What should be the "productIdentifiers"?
Started by apps30 Dec 21 2018 02:59 AM

3 replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

apps30

[GLOBAL: userInfoPane.html]
apps30
  • Enthusiast

  • 76 posts
  • Corona SDK

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


[TOPIC: post.html]
#2

apps30

[GLOBAL: userInfoPane.html]
apps30
  • Enthusiast

  • 76 posts
  • Corona SDK

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?



[TOPIC: post.html]
#3

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,646 posts
  • Enterprise

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

 

Rob



[TOPIC: post.html]
#4

apps30

[GLOBAL: userInfoPane.html]
apps30
  • Enthusiast

  • 76 posts
  • Corona SDK

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()




[topic_controls]
[/topic_controls]