Following the documentation instructions located here on this RevenueCat “checking-if-a-user-is-subscribed” page i’ve been unable to async verify is a user is already subscribed. My code is as follows:
```const checkIfPurchased = async () => {
try {
await Purchases.configure({ apiKey: APIKeys.apple });
await Purchases.syncPurchases();
const customerInfo = await Purchases.getCustomerInfo();
const ENTITLEMENT_ID = 'app_199_1m';
if (
typeof customerInfo.entitlements.active[ENTITLEMENT_ID] !== 'undefined'
) {
setSubscription(true);
}
return user?.subscription;
} catch (e) {
Bugsnag.notify(`Error checkIfPurchased(): ${e}`);
}
};
this does not work. I get undefined for customerInfo.entitlements.active[ENTITLEMENT_ID]
. What am I missing?