How to use the react-native-purchases.setup function in react-native-purchases

To help you get started, we’ve selected a few react-native-purchases examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github RevenueCat / react-native-purchases / example / App.js View on Github external
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)}`);
github Flaque / quirk / src / payments / index.ts View on Github external
export const setupRevenutCat = async () => {
  Purchases.setDebugLogsEnabled(!!__DEV__);
  Purchases.setup(REVENUECAT_API_KEY);

  if (Platform.OS === "ios") {
    Purchases.automaticAppleSearchAdsAttributionCollection = true;
  }
};