INNER CODE UNIT · TypeScript

getCurrentPurchasableSubscription

Flaque/quirk · src/payments/index.ts:35

export const getCurrentPurchasableSubscription = async (): Promise<Product> => {
  const entitlements = await Purchases.getEntitlements();
  return entitlements.subscription[getMainOffering()];
};

export const isSubscribed = async (): Promise<boolean> => {
  try {
    if (await isGrandfatheredIntoFreeSubscription()) {
      return true;
    }

    const purchaserInfo = await Purchases.getPurchaserInfo();
    return isValidPurchaserInfo(purchaserInfo);
  } catch (err) {
    log("User let in on error", err);
    Sentry.captureException(err);
    return true; // TODO set this to false once you figure out the error
  }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…