INNER CODE UNIT · TypeScript
setupRevenutCat
Flaque/quirk · src/payments/index.ts:25
export const setupRevenutCat = async () => {
Purchases.setDebugLogsEnabled(!!__DEV__);
Purchases.setup(REVENUECAT_API_KEY);
if (Platform.OS === "ios") {
Purchases.automaticAppleSearchAdsAttributionCollection = true;
}
};
// Note that subscriptions can change prices or structure all the time.
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()) {