Hello
I am developing an application with React Native Expo, but I am getting the error below. My configurations are complete, I was able to pull the products before and made the purchase.
LOG Error fetching products: :Error: There is no singleton instance. Make sure you configure Purchases before trying to get the default instance. More info here: https://errors.rev.cat/configuring-sdk]
React.useEffect(() => {
Purchases.isConfigured().then((configured) => {
if (!configured) {
const resp = Purchases.configure({ apiKey: Platform.OS == "android" ? "goo******" : "ap/***********n" });
console.log("resp",resp) //undefined
} else {
fetchProducts()
}
})
}, ]);
const fetchProducts = async () => {
try {
const offerings = await Purchases.getOfferings();
const availableProducts = offerings.current?.availablePackages;
setProducts(availableProducts || s]);
} catch (error) {
console.log("Error fetching products: ", error);
}
};