Add In App Purchases to Your App

This feature is not available on all plans.

After you have created your in app purchases for iOS and Android, it's time to add them to your app. Here's an overview:

  1. Create the purchase page and add it to your app menu.
  2. Add the in app purchase plugin(s) to your site.
  3. Setup your validator

If using subscriptions, you can only have one subscription level in the app.

Create the Purchase Page

Begin by creating a new custom HTML page in your app customizer. Add this code to start:

Edit the price, terms, and description. Apple requires you to have a link to your privacy policy, and an exact description of what the user gets and how they are charged.

The <in-app-purchase> component outputs a form that includes an email field for user registration. After purchase, a user is created through our in app purchase plugin.

productId - (required) must match your iOS in app purchase product ID
productIdAndroid - (optional) only use this if product ID is different for Android, otherwise Android will use productId above
isSubscription - (optional) set to "false" if this is a one-time purchase
removeAds - (optional) set to "true" if this purchase should remove Admob Ad banners
noLogin - (optional) set to "true" if login, registration, and validation with WordPress are not required. For example, if this purchase is just to remove ads in the app. No user will be created in WordPress.

Save this page and add it to your menu.

Testing Purchases

First, login to your WordPress site and visit the AppPresser settings. Click the "Log" tab, then check "enable logging." This will allow you to see the API calls if there is a problem.

If you setup test users as per our documentation, you can build the app with dev certs for iOS, and no key for Android. Download the app to your test device and try the purchase. 

For iOS, you will be prompted to login. Use your sandbox tester email and password.

For Android, you can add yourself as a tester in the Google Play Console under Settings => Manage Testers. You should be able to test the purchase with your normal account, or you can log in as a tester.

Test subscriptions do not match the normal schedule, you can look up the renewal times online.

Click here for a detailed article on testing Android in app purchases.