Question

Cordova plugin doesn't fetch subscription item

  • 15 November 2023
  • 1 reply
  • 15 views

Badge +2

Hey guys, I can’t see to retrieve subscription-based products, however consumables work. Here is my code:

import 'cordova-plugin-purchase';

const { store, LogLevel, Platform, ProductType } = CdvPurchase;

await store.register([
{
id: 'monthly',
platform: Platform.GOOGLE_PLAY,
type: ProductType.PAID_SUBSCRIPTION
},
{
id: 'trimonthly',
platform: Platform.GOOGLE_PLAY,
type: ProductType.PAID_SUBSCRIPTION
},
{
id: 'semiannually',
platform: Platform.GOOGLE_PLAY,
type: ProductType.PAID_SUBSCRIPTION
}
]);

console.log(store.products); // []

 

Screenshot:

 

Help is much appreciated 🙏


1 reply

Badge +2

Fixed, id should be the subscription ID and not offer ID.

Reply