Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Google IAP - Product details for subscription is not showing up. Need little info
Started by madan Mar 29 2018 01:27 AM

14 replies to this topic
iap google iap in-app android
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

madan

[GLOBAL: userInfoPane.html]
madan
  • Enthusiast

  • 35 posts
  • Corona SDK

I am not getting the details related to subscription in the call

store.loadProducts( productIdentifiers, productListener ) Its showing up as invalid products.
But I am getting details related to other consumables.

{
  invalidProducts = { "product_identifier" },
  name = "productList",
  products = {}
}

This is the response.

I am not sure something is wrong with google or corona. But i am able to purchase the product. I need the details to show localized price. Also for subscription I am using puchaseSubscrption function.

Any information would be helpful..



[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,925 posts
  • Enterprise

Can you file a bug report on this? A small demo app that shows the problem would be useful.

 

Rob



[TOPIC: post.html]
#3

madan

[GLOBAL: userInfoPane.html]
madan
  • Enthusiast

  • 35 posts
  • Corona SDK

Bug as been reported!

Madan



[TOPIC: post.html]
#4

catalin8

[GLOBAL: userInfoPane.html]
catalin8
  • Observer

  • 4 posts
  • Corona SDK

I had the same problem since i started to integrate the subscriptions payment method in the app we are developing at my company. At the begining i thought it was no  way to build the subscription products load from the google play store without hard coding it, but today I found the solution after read the plugin code (here) and testing it.

 

The problem comes with the iap.v3 plugin docuementation. They say the plugin signature is the following:

store.loadProducts( productIdentifiers, productListener )

but it's not quite true. The loadProducts method accepts these two ways of  call:

store.loadProducts( managedProductIdentifiers, productListener )

and

store.loadProducts( managedProductIdentifiers, subscriptionProductIdentifiers, productListener )

They test if the second parameter it's a lua table and then they request it as subscriptions. When the second parameter it's the listener they don't  query the subscription products. In the listener the products key it's returned as a single array with all the products managed and subscriptions.

 

You can find the reference at the plugin implementation of loadProducts (here line 213 to 265).

 

With that method in combination with another undocumented method purchaseSubscription it seems to work well.

 

Hope this help you and other people having the same problem.



[TOPIC: post.html]
#5

troylyndon

[GLOBAL: userInfoPane.html]
troylyndon
  • Contributor

  • 617 posts
  • Corona SDK

I'm having the same problem - my subscription products are being returned from Google Play as .invalidProducts - but I'm not using Enterprise, so am I out of luck? Is it broken for Corona PRO ?

 

I remember having ads in a previous version, and this was working without difficulty about 18 months ago.

 

I've made sure to upload the APK to the beta console in our Google developer account. But when I install my APK via USB cable, the identical version to what is in Google Play Beta, the products are showing up as invalid, and I've tried everything I can think of.

 

Can anyone help tell me determine what I'm doing wrong?



[TOPIC: post.html]
#6

troylyndon

[GLOBAL: userInfoPane.html]
troylyndon
  • Contributor

  • 617 posts
  • Corona SDK

Update: Still not working on Android. It seems to be working for me on iOS.



[TOPIC: post.html]
#7

troylyndon

[GLOBAL: userInfoPane.html]
troylyndon
  • Contributor

  • 617 posts
  • Corona SDK

@Catalin8, the solution you came up with - it requires Enterprise, right? Is this something that Corona needs to fix for us non-Enterprise users?



[TOPIC: post.html]
#8

troylyndon

[GLOBAL: userInfoPane.html]
troylyndon
  • Contributor

  • 617 posts
  • Corona SDK

@Rob, using loadProducts, iOS is picking my subscription product fine. But Google Play is showing it as an invalid product, even though GP is showing my new subscription product as "Active", and I've been sure to upload the APK into Beta release. Is Corona SDK still supporting Google Play subscriptions as part of the loadProducts list? I had this working about 18 months ago - the same code now, isn't and I"m experiencing exactly what @catalin8 described here. Any thoughts?



[TOPIC: post.html]
#9

catalin8

[GLOBAL: userInfoPane.html]
catalin8
  • Observer

  • 4 posts
  • Corona SDK

@troylyndon the subscription products are supported (this is not mentioned in the documentation), but only passing it in a different list as a second parameter with loadProducts method as i mentioned before loadProducts(managedIdsList, subscriptionIdsList, listener). You will receive the results with the managed and subscriptions in the same list of products. To purchase a subscription you must use the method purchaseSubscription instead of purchase.

 

For ios it's working as expected with loadProducts(productIdsList, listener) and with the purchase method.

 

On the other hand we have been using Corona Enterprise, but we have moved to Corona native. We received the license for splash screen until the enterprise expire, so i think you don't need any license for that. Maybe somebody from @corona can explain it to us. 



[TOPIC: post.html]
#10

troylyndon

[GLOBAL: userInfoPane.html]
troylyndon
  • Contributor

  • 617 posts
  • Corona SDK

@catalin8, you are the man! The product is now in the list. Thank you.

@Rob, I really think you should add this point to your documentation.



[TOPIC: post.html]
#11

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,925 posts
  • Enterprise

Please go to the relevant documentation page and use the "Report an issue" button at the bottom. Provide details and an example if you can.

 

Thanks!

Rob



[TOPIC: post.html]
#12

troylyndon

[GLOBAL: userInfoPane.html]
troylyndon
  • Contributor

  • 617 posts
  • Corona SDK

Until Corona updates its documention for loadProducts, which I have just reported, this solution solves this problem of loading products with subscriptions.

 

HOWEVER, the store.purchase does bring up the purchase dialog properly, but then the transaction fails because of something Corona needs to do. So, I would not recommend attempting this until Corona supports subscription purchases properly for Android.

 

SYNTAX
store.loadProducts( productIdentifiers, subscriptionIdentifiers, productListener )

subscriptionIdentifiers (optional)

Table. An array of strings indicating a list of subscription product identifiers.
 



[TOPIC: post.html]
#13

troylyndon

[GLOBAL: userInfoPane.html]
troylyndon
  • Contributor

  • 617 posts
  • Corona SDK

@Rob, even though the code above does load subscription products after the consumable products in the array, when I choose store.purchase(subscriptionID) it does bring up the proper subscription to complete the purchase, but unfortunately, the transactionCallback fails

 

In transactionCallback    failed
state=failed
Transaction failed, type:    -1008    IAB returned null purchaseData or dataSignature (response: -1008:Unknown error)    ulmoves

 

(NOTE: ulmoves is my subscription ID)

 

How soon can Corona fix this? I can see why the subscriptionsIDs were not documented in the loadProducts function.

https://developer.android.com/google/play/billing/billing_java_kotlin



[TOPIC: post.html]
#14

catalin8

[GLOBAL: userInfoPane.html]
catalin8
  • Observer

  • 4 posts
  • Corona SDK

@troylyndon To achieve the purchase of a subscription you should use the method store.purchaseSubscription(subscriptionID) in Android. It's an undocumented method, but it seems to work correctly. I have tested it last weeks and i didn't found any issue.



[TOPIC: post.html]
#15

troylyndon

[GLOBAL: userInfoPane.html]
troylyndon
  • Contributor

  • 617 posts
  • Corona SDK

@catalin8, seems to work, THANK YOU




[topic_controls]
[/topic_controls]