Question

Offerings not loading on IOS

  • 8 September 2023
  • 1 reply
  • 56 views

Badge +1

Hello everyone I am hardstuck with this issue since 1 week,

Products are loaded on play store(i can buy subscription start free trial use promocode etc correctly), but on IOS on a real device, running the development build, with a sandbox user offerings are not loading and I get this error

There is an issue with your configuration. Check the underlying error for more details. There's a problem with your configuration. None of the products registered in the RevenueCat dashboard could be fetched from App Store Connect (or the StoreKit Configuration file if one is being used).
More information: https://rev.cat/why-are-offerings-empty]
I already triple-checked everything inside this
https://community.revenuecat.com/sdks-51/why-are-offerings-or-products-empty-124
paid app agreement is signed and is in the “Verifying” state, the subscriptions are in "ready fro submission", bundle id matches everything is setup correctly, but still I can't make this work, and keep getting this error.

The credentials are correct, and the App-Specific Shared Secret is also correct, credentials are the same for test flight and production, some people told me that the Paid Apps agreement neds to be Active while our is in the Verifying state, other people told me I need to submit the build without payments, make them accept the build, and then I can re-upload the build with payments and it will magically work again.

I don't know what more I can do..

 

 

this is my custom hook:
 

const APIKeys = {   apple: Constants.expoConfig!.extra!.IOS_REVENUECAT_API_KEY,   google: Constants.expoConfig!.extra!.ANDROID_REVENUECAT_API_KEY, };


export default function useRevenueCat() {   const navigation: any = useNavigation();

  const [currentOffering, setCurrentOffering] = useState<PurchasesOffering | null>(null);   const [customerInfo, setCustomerInfo] = useState<CustomerInfo | null>(null);   const [isPremium, setIsPremium] = useState(false);

  const user = useSelector((state: UserType) => state.user);

  useEffect(() => {     Purchases.setLogLevel(LOG_LEVEL.DEBUG)     if (customerInfo)       setIsPremium(customerInfo.entitlements.active.premium != undefined);   }, [customerInfo]);

  const setup = useCallback(async () => {     try {       const apiKey = Platform.OS === "android" ? APIKeys.google : APIKeys.apple;       if (!apiKey)         throw new Error("API key is not defined");

      Purchases.configure({ apiKey })       const offerings = await Purchases.getOfferings();       console.log(offerings)       const customerInfo = await Purchases.getCustomerInfo();       console.log(customerInfo)       setCurrentOffering(offerings.current);       if (customerInfo)         setCustomerInfo(customerInfo);     } catch (error) {       console.error(error);     }   }, []);

  useEffect(() => {     setup();   }, [setup]);

  useEffect(() => {     const customerInfoUpdated = async (info: CustomerInfo) => {       setCustomerInfo(info);     }     Purchases.addCustomerInfoUpdateListener(customerInfoUpdated);

    return () => {       Purchases.removeCustomerInfoUpdateListener(customerInfoUpdated);     };   }, []);

  async function handlePurchase(occurrence: "monthly" | "annual") {     if (!currentOffering?.[occurrence] || isPremium) return;

    const purchaserInfo = await Purchases.purchasePackage(currentOffering[occurrence]!);

    const updatedCustomerInfo = await Purchases.getCustomerInfo();     setCustomerInfo(updatedCustomerInfo);

    if (purchaserInfo.customerInfo.entitlements.active.premium)       navigation.goBack();   }

  async function restorePurchases() {     const customerInfo = await Purchases.restorePurchases();

    const updatedCustomerInfo = await Purchases.getCustomerInfo();     setCustomerInfo(updatedCustomerInfo);

    if (customerInfo.entitlements.active.premium) navigation.goBack();     else alert("Non hai acquisti da ripristinare");   }

  return {     currentOffering,     customerInfo,     isPremium,     handlePurchase,     restorePurchases   }

}


1 reply

Userlevel 3
Badge +8

Hi, sorry to hear you are having trouble with this. The solutions in the troubleshooting guide above normally solve this, but I have a couple of other suggestions. Some developers have recreated their products and it has then fixed this. Another thing to note would be if you have additional products registered in RevenueCat but are not in App Store Connect then you’ll want them to be there as well as it could potentially raise this error as well.

Reply