Skip to main content
Solved

Ionic's Purchases plugin can't get any entities

  • August 2, 2021
  • 1 reply
  • 154 views

Forum|alt.badge.img+4

So I'm using the @ionic-native/purchases plugin for setting up in-app subscriptions. The only plugin-related code I have is

    this.purchases.setDebugLogsEnabled(true);
    this.purchases.setup(environment.purchasesAPIKey, appUserID);

on the app's initializing.

And then in another component:

    this.purchases.getPurchaserInfo().then((purchaserInfo) => {
      console.log('purchaserInfo:', JSON.stringify(purchaserInfo));
    });
    this.purchases.getOfferings().then((offerings) => {
      console.log('offerings:', JSON.stringify(offerings));
    });
    this.purchases.getProducts(['product1_test']).then((products) => {
      console.log('products:', JSON.stringify(products));
    });
    console.log('appUserID:', this.purchases.getAppUserID());

 

All the methods return empty lists / objects, e.g.:

offerings: {"all":{},"current":null}

 

Even though the underlying request that I found in Android Studio's Profiler gives back proper offerings data:

{
  "current_offering_id": "default",
  "offerings": [
    {
      "description": "Standard Set of Packages",
      "identifier": "default",
      "packages": [
        {
          "identifier": "$rc_monthly",
          "platform_product_identifier": "product1_test"
        }
      ]
    }
  ]
}

Best answer by ryan

If the products or offerings are null, it’s usually due to some configuration issue in Apple / Google. We’ve outlined the reasons for this in our Empty Products article here: 

 

View original
Did this post help you find an answer to your question?
This post has been closed for comments

1 reply

ryan
RevenueCat Staff
Forum|alt.badge.img+9
  • RevenueCat Staff
  • 391 replies
  • Answer
  • August 4, 2021

If the products or offerings are null, it’s usually due to some configuration issue in Apple / Google. We’ve outlined the reasons for this in our Empty Products article here: 

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings