Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async componentDidMount() {
Purchases.setDebugLogsEnabled(true);
Purchases.setup("api_key");
try {
const purchaserInfo = await Purchases.getPurchaserInfo();
if (typeof purchaserInfo.entitlements.active.pro_cat !== "undefined") {
this.setState({
load: "Cats",
loading: false
});
} else {
this.setState({
load: "Upsell",
loading: false
});
}
} catch (e) {
// eslint-disable-next-line no-console
console.log(`Error ${JSON.stringify(e)}`);
export const setupRevenutCat = async () => {
Purchases.setDebugLogsEnabled(!!__DEV__);
Purchases.setup(REVENUECAT_API_KEY);
if (Platform.OS === "ios") {
Purchases.automaticAppleSearchAdsAttributionCollection = true;
}
};