How to use the expo-in-app-purchases.connectAsync function in expo-in-app-purchases

To help you get started, we’ve selected a few expo-in-app-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 expo / expo / apps / expo-payments / App.js View on Github external
async componentDidMount() {
    // This method must be called first to initialize listeners and billing client
    const history = await connectAsync();

    /*
      These item entries are created in App Store Connect and Google Play Console respectively.
      If you want to add more or edit their attributes you can do so there.
    */
    const items = Platform.select({
      ios: [
        'dev.expo.products.premium',
        'dev.expo.payments.updates',
        'dev.expo.payments.adfree',
        'dev.expo.payments.gold',
      ],
      android: ['gas', 'premium', 'gold_yearly', 'gold_monthly'],
    });

    // Get product details