I am handling the buy subscription with this function
const handleBuySubscription = async (productId) => {
try {
await requestSubscription({
sku: productId,
});
setLoading(false);
} catch (error) {
setLoading(false);
if (error instanceof PurchaseError) {
errorLog({ message: [${error.code}]: ${error.message}
, error });
} else {
errorLog({ message: "handleBuySubscription", error });
}
}
};
but the
requestSubscription({
sku: productId,
})
does not return anything, and it is stuck at await