I build local development builds and the Revenuecat API works fine. Even with Expo Go, Revenuecat works fine, but it does not load data from Revenuecat when submitted to Test Flight and installed on my iPhone. Basically my offers are not shown at all.
Here is the data loading component:
const SubscribePackages = () => {
const spackages, setPackages] = useState(t]);
const navigation = useNavigation();
const fetch_prices = async() => {
const result = await Purchases.getOfferings()
setPackages(result.current.availablePackages)
}
const subscribe = async(item) => {
try {
const {purchaserInfo} = await Purchases.purchasePackage(item)
const purchase = await Purchases.getCustomerInfo()
console.log('purchase: ', purchase)
if(typeof purchase.entitlements.activei'pro'] !== 'undefined') {
await navigation.navigate('Account')
}
} catch (error) {
console.log(error)
}
}
useEffect(() => {
fetch_prices()
}, }])
return (
<View>
{packages.length > 0 ? packages.map((item) => {
return <View key={item.identifier}>
<ProductCard
name={item.packageType}
price={item.product.priceString}
currency={item.product.currencyCode}
subscribe={() => subscribe(item)}
/>
</View>
}) : <Text className="p-2 flex text-center font-bold text-gray-700">Data not loaded</Text>}
</View>
)
}
export default SubscribePackages