Skip to main content
Question

Empty offerings, but the Products were found & imported by Revenue Cat


Forum|alt.badge.img+6
  • Dedicated Member
  • 27 replies

When I try to query Purchases.getOfferings it results in an error

const getPackages = async () => {
   try {
     const offerings = await Purchases.getOfferings();
      if (
          offerings.current !== null &&
          offerings.current.availablePackages.length !== 0
        ) {
          setPackages(offerings.current.availablePackages);
        }
    } catch (e) {
        Alert.alert('Error getting offers', e.message);
    }
};

getPackages();

What have I done so far?

  1. I have my EAS local device & simulator build with bundleIdentifier: com.myapp.dev
    1. this includes installing the RevenueCat SDK
  2. I have TestFlight App setup with my bundleIdentifier : com.myapp.production
  3. Following the Product setup Guide, inside TestFlight App, I have my subscription group "Core" setup
  4. Inside Core subscription group, I have my "Subscriptions" added: Monthly & Annual which show in "Ready to Submit" status
  5. I setup my Revenue Cat API
  6. Inside Revenue Cat, I added Product. I was able to use the automated Import from the Subscription items I set in test flight
  7. Then I created an Offering which includes my 2 subscriptions
  8. Then I created an Entitlement which includes the 2 products

It seems like if my products were automatically imported from TestFlight into RevenueCat, then the configuration appears correct?

Products added, from Automated Import
Entitlements added
Offering added

I also tried adding a Sandbox Tester inside test flight, but I dont think has made any difference.

This is the official response from Revenue Cat about how to handle this error, which I have triple checked: https://community.revenuecat.com/sdks-51/why-are-offerings-or-products-empty-124

Any ideas?

 

what about the bundle identity between dev & TestFlight prod?

11 replies

Forum|alt.badge.img+6
  • Author
  • Dedicated Member
  • 27 replies
  • October 25, 2023

I also tried Purchases.getProducts(['core_annual', 'core_annual']);  but it returns `[ ]` unfortunately.  


Forum|alt.badge.img+5
  • Member
  • 9 replies
  • January 6, 2024

Hey! Im struggling with this error in expo also. I imported my products directly from the App Store and i still get this error. Crazy but I also tried calling getProducts() - all failed.

I have signed the agreements and done literally everything, please help


Forum|alt.badge.img+5
  • Member
  • 9 replies
  • January 6, 2024
lucksp wrote:

I also tried Purchases.getProducts(['core_annual', 'core_annual']);  but it returns `[ ]` unfortunately.  

Struggling with the same problem. Please did you find a solution?


Forum|alt.badge.img+6
  • Author
  • Dedicated Member
  • 27 replies
  • January 6, 2024

@kc3f0337 are you testing on simulator or physical device?


Forum|alt.badge.img+5
  • Member
  • 9 replies
  • January 6, 2024

thanks for your reply. yes, i’m testing on a real device, always have 


Forum|alt.badge.img+6
  • Author
  • Dedicated Member
  • 27 replies
  • January 6, 2024

On load of my paywall I do:

 

useEffect(
    function offerings() {
      async function getOfferings() {
        try {
          if (!Device.isDevice) return;

          const offerings = await Purchases.getOfferings();
          if (offerings.current?.availablePackages.length) {
            setOfferings(offerings);
            setActivePkg(offerings.current?.availablePackages[0]);
          }
        } catch (e) {
          setMessage(['error', 'Error retrieving products.']);
          console.error(e);
        } finally {
          setIsLoading(false);
        }
      }

      if (!isReady) return;
      getOfferings();
    },
    [setMessage, isReady]
  );

 


Forum|alt.badge.img+5
  • Member
  • 9 replies
  • January 6, 2024

thanks very much for the code, currently i’m just console logging the offerings. using the code from the documentation. I would try this also.

 

Was there any point where you deleted the produts you had on app connect and restarted?


Forum|alt.badge.img+6
  • Author
  • Dedicated Member
  • 27 replies
  • January 6, 2024

I don’t think I deleted anything….if the products are showing up with the snippet I posted above, then your store is connected to Revenue Cat.  

 

I am thinking the `getProducts` API is for something else, but I didn’t look any deeper.


Forum|alt.badge.img+5
  • Member
  • 9 replies
  • January 6, 2024

Here is what I have. Product imported from the app store connect


Forum|alt.badge.img+5
  • Member
  • 9 replies
  • January 6, 2024

Im not using subscription products, im using consumable products


Forum|alt.badge.img+5
  • Member
  • 9 replies
  • January 6, 2024

I might actually kill myself over this cause I’ve become extremely frustrated. I am extremely serious now. This is a monopoly with a poor functioning product. I’ve been stuck on this for days and its really frustrating.

 

What the actual fuck man? Ive done literally everything


Reply


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