PDA

View Full Version : Unable to get purchase flow started for a Subscription type Product on Google Play



syedfarhan
27th July 2018, 07:35
Hi! I registered two in-app products on Google Play. One Unlockable Managed Product and another Consumable Subscription type product. Then following the instruction given in 'Qt Purchasing' documentation I added the required code. However, I can successfully start purchase flow (call purchase() method) on Unlockable Managed Product but when I call purchase() on the Consumable Subscription Type product, I get error Attempted to purchase unregistered product

Here is my code



Store
{
id: globalInAppStore
Product
{
id: tbiosUnlockable
identifier: "tbios_drugquery_temp_prod"
type: Product.Unlockable
onPurchaseFailed: {
console.log("purchase failed!", transaction.orderId)
}
onPurchaseSucceeded: {
console.log("purchase succeeded!", transaction.orderId)
}
}
Product
{
id: tbiosYearlySubscription
identifier: "tbios_drugquery_inappsub_yearly"
type: Product.Consumable
onStatusChanged: {
switch (status)
{
case Product.PendingRegistration: console.debug("Registering " + identifier); break
case Product.Registered: console.debug(identifier + " registered with price " + price); break
case Product.Unknown: console.debug(identifier + " was not found in the market place"); break
}
}
onPurchaseFailed: {
console.log("purchase failed!", transaction.orderId)
}
onPurchaseSucceeded: {
console.log("purchase succeeded!", transaction.orderId)
}
}
}

And I call it like


tbiosYearlySubscription.purchase();
tbiosUnlockable.purchase();

Any idea what could be causing this issue?