How to use the react-native-purchases.getPurchaserInfo 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 / screens / CatsScreen.js View on Github external
async componentDidMount() {
    try {
      const info = await Purchases.getPurchaserInfo();
      this.handleInfo(info);
    } catch (e) {
      // eslint-disable-next-line no-console
      console.log("Error handling");
    }
  }
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 latestExpirationDate = async (): Promise => {
  const purchaserInfo = await Purchases.getPurchaserInfo();
  return purchaserInfo.latestExpirationDate;
};