# IAPHUB

*Skill Level: Expert*

{% hint style="warning" %}
The forgot password flow needs to be made manually using a screen, temporary password, and email with all implementations of IAPHUB.
{% endhint %}

## Before You Begin

* Make sure you are very familiar with Adalo, the [database](https://help.adalo.com/~/revisions/kmzOxqjy7C9sXGVjDKKb/database), and [how to install components](https://help.adalo.com/~/revisions/kmzOxqjy7C9sXGVjDKKb/component-basics/marketplace-components) from the marketplace.
* You will need an [IAPHUB](https://iaphub.com) account to use this integration.
* You will need at least the Adalo Starter plan to use this feature.
* Please prepare to spend 1-3 days implementing this feature. The setup can be complex and may require some approval from the app stores.

## Walkthrough

{% hint style="info" %}
**When do I need In-App Purchases?**

In-app purchases are needed in two main scenarios:

1. You are selling access to or features of your app.
2. You are selling digital goods such as downloads, credits, seats, licenses, or other non-physical items.
   {% endhint %}

#### 1.  Complete the following guides for Google first (if releasing on Android):

1. [Create Your Google Developer Account](https://help.adalo.com/~/revisions/kmzOxqjy7C9sXGVjDKKb/testing-your-app/publishing-to-the-google-play-store/create-your-google-developer-account)
2. [Create Your Firebase Project](https://help.adalo.com/~/revisions/kmzOxqjy7C9sXGVjDKKb/testing-your-app/publishing-to-the-google-play-store/create-your-firebase-project)
3. [Register Android App and Download Config File](https://help.adalo.com/~/revisions/kmzOxqjy7C9sXGVjDKKb/testing-your-app/publishing-to-the-google-play-store/register-android-app-and-download-config-file)
4. [Generate and Download the Private Key](https://help.adalo.com/~/revisions/kmzOxqjy7C9sXGVjDKKb/testing-your-app/publishing-to-the-google-play-store/generate-and-download-private-key)

#### 2. Complete the following guides for Apple first (if releasing on iOS):

1. [Create Your Apple Developer Account](https://help.adalo.com/~/revisions/kmzOxqjy7C9sXGVjDKKb/testing-your-app/publishing-to-the-apple-app-store/create-your-apple-developer-account)
2. [Setup Annual Payment for Your Apple Developer Account](https://help.adalo.com/~/revisions/kmzOxqjy7C9sXGVjDKKb/testing-your-app/publishing-to-the-apple-app-store/setup-annual-payment-for-your-apple-developer-account)
3. [Create Your App Bundle ID](https://help.adalo.com/~/revisions/kmzOxqjy7C9sXGVjDKKb/testing-your-app/publishing-to-the-apple-app-store/create-your-apple-bundle-id)
4. [Create Your Adalo "App-Specific Password"](https://help.adalo.com/~/revisions/kmzOxqjy7C9sXGVjDKKb/testing-your-app/publishing-to-the-apple-app-store/create-your-adalo-app-specific-password)

#### 3. Create your IAPHUB account.

If you haven't already done so, please go to [IAPHUB](https://www.iaphub.com/) and create a free account.

#### 4. Decide which components you need to use.

IAPHUB offers two methods for integrating in-app purchases into your apps. Which one you choose will be base on the types of products or services you're offering and on which platform. You can use the table below for native apps, or use the decision tree below that for greater nuance.

<table><thead><tr><th width="190">Product Type</th><th width="172">Description</th><th width="177.66666666666669">IAPHUB Components to Use</th><th width="233.33333333333331">Examples</th></tr></thead><tbody><tr><td>Consumable</td><td>Items consumed by the user and must be repurchased after they are used up.</td><td>Start and Custom Paywall</td><td>Credits, tickets, game items, or boosts.</td></tr><tr><td>Non-consumable</td><td>Items that do not expire and cannot be used up by the user.</td><td>Start and Custom Paywall</td><td>A photo library, PDF templates, or downloads.</td></tr><tr><td>Non-renewing subscription</td><td>Paid access to an app or feature on a given interval for a limited amount of time.</td><td>Start and Plug-and-Play Paywall <strong>OR</strong> Start and Custom Paywall</td><td>Live yoga classes for a year, 4 weeks of virtual therapy, 9 month pregnancy tracker.</td></tr><tr><td>Auto-renewing subscription</td><td>Paid access to an app or feature on a given interval until the subscription is cancelled.</td><td>Start and Plug-and-Play Paywall <strong>OR</strong> Start and Custom Paywall</td><td>Live yoga classes, up to 5 collaborators/month, unlimited exports, custom branding.  </td></tr></tbody></table>

{% embed url="<https://www.figma.com/file/ffWalsXkvBxJsH3aqhx7xd/Payments-Decision-Tree?node-id=0:1&t=cBnHOL0Iu5KyACfu-1>" %}

#### 5. Create your app  in IAPHUB dashboard.

Follow [this guide from IAPHUB to create your app](https://www.iaphub.com/docs/getting-started/) in the IAPHUB dashboard.

#### 6. Install the "Start" IAPHUB component from the Adalo Marketplace and place in your app.

You can use [this guide](https://www.iaphub.com/docs/set-up-sdk/adalo-component/start) from IAPHUB to ensure you are installing the component correctly.&#x20;

{% hint style="info" %}
**NOTE:** The Start component is required for all product types, even consumable and non-consumable products. This component is how IAPHUB tracks your users, products, and purchases.
{% endhint %}

#### 7.  Install either the Plug and Play Paywall or Custom Paywall (use [the table](https://app.gitbook.com/o/-Lha7TPH_T7jnvspjvYs/s/-LhGHkPsv15svPIU5I7C/~/changes/5DfilxPDN1qPpU2MEtQt/integrations/iaphub#4.-decide-which-components-you-need-to-use.) above to decide)

* Use [this guide](https://www.iaphub.com/docs/set-up-sdk/adalo-component/paywall) from IAPHUB for setting up the Plug-and-Play Paywall
* Use [this guide](https://www.iaphub.com/docs/set-up-sdk/adalo-component/custom-paywall) from IAPHUB for setting up a Custom Paywall/Consumables Purchase&#x20;

{% hint style="info" %}
At this point, it makes sense to go ahead and completely finish the creation of your app as if you are ready to fully test it. Testing in-app payments before the rest of your app is complete will likely create more work for you in the long run.
{% endhint %}

#### 8. Complete the following guides for Google (if releasing on Android):

1. [Get Your Build File](https://help.adalo.com/~/revisions/kmzOxqjy7C9sXGVjDKKb/testing-your-app/publishing-to-the-google-play-store/get-your-build-file)
2. [Upload Your App to Google for Testing](https://help.adalo.com/~/revisions/kmzOxqjy7C9sXGVjDKKb/testing-your-app/publishing-to-the-google-play-store/upload-your-app-to-google-and-create-your-store-listing)

#### 9. Complete the following guide for Apple (if releasing on iOS):

1. [Start your build in Adalo](https://help.adalo.com/~/revisions/kmzOxqjy7C9sXGVjDKKb/testing-your-app/publishing-to-the-apple-app-store/start-your-build-in-adalo)

#### 10. Complete the following guides from IAPHUB to configure the Google backend:&#x20;

1. [Configure the Google Play API](https://www.iaphub.com/docs/set-up-android/configure-google-play-api)
2. [Configure IAPHUB Google Server Notifications](https://www.iaphub.com/docs/set-up-android/configure-server-notifications) (optional, but highly recommended)
3. [Configure Google Sandbox Testing](https://www.iaphub.com/docs/set-up-android/configure-sandbox-testing)
4. [Create auto-renewable subscription](https://www.iaphub.com/docs/set-up-android/create-auto-renewable-subscription) (if offering subscriptions) If you are offering consumables or non-consumable product types, please set those up under the In-app products portion of Google Play Console as show below:&#x20;

<figure><img src="https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LhGHkPsv15svPIU5I7C%2Fuploads%2FSaESzGM2dFIl0KklByzZ%2FScreen%20Shot%202023-01-09%20at%204.13.37%20PM.png?alt=media&#x26;token=1f20e84f-3449-4efc-ae92-dac2c0579db6" alt=""><figcaption></figcaption></figure>

#### 11. Complete the following guides from IAPHUB to configure the Apple backend:

1. [Configure Shared Secret](https://www.iaphub.com/docs/set-up-ios/configure-shared-secret)
2. [Configure IAPHUB Apple Server Notifications](https://www.iaphub.com/docs/set-up-ios/configure-server-notifications) (optional, but highly recommended)
3. [Configure Apple Sandbox Testing](https://www.iaphub.com/docs/set-up-ios/configure-sandbox-testing)
4. [Create a Subscription Group](https://www.iaphub.com/docs/set-up-ios/create-subscription-group) (if offering subscriptions)&#x20;
5. [Create auto-renewing Subscription](https://www.iaphub.com/docs/set-up-ios/create-auto-renewable-subscription) (if offering this product type)

If you are offering consumables or non-consumable product types, please set those up in the In-App Purchases portion of App Store Connect as shown below:

<figure><img src="https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LhGHkPsv15svPIU5I7C%2Fuploads%2FXC41pvsqiZycDQuUn7XA%2FScreen%20Shot%202023-01-09%20at%204.20.01%20PM.png?alt=media&#x26;token=93f9d90c-f4eb-4f80-826d-2680639cfe5f" alt=""><figcaption></figcaption></figure>

#### 12. Now that you have created your products in Google Play and App Store Connect, you can use those Product or Subscription IDs to create the Products in IAPHUB.

* Please follow [this guide](https://www.iaphub.com/docs/getting-started/create-products) from IAPHUB to create the products in the IAPHUB dashboard.

#### 13. For Apple, subscriptions live inside Subscription Groups (as seen in #4 in [Step 11](https://app.gitbook.com/o/-Lha7TPH_T7jnvspjvYs/s/-LhGHkPsv15svPIU5I7C/~/changes/5DfilxPDN1qPpU2MEtQt/integrations/iaphub#11.-complete-the-following-guides-from-iaphub-to-configure-the-apple-backend) above). This means you also need to create a Subscription Group inside of IAPHUB.

* Follow [this guide](https://www.iaphub.com/docs/getting-started/create-subscription-groups) from IAPHUB to create the Subscription Group on the IAPHUB dashboard.

#### 14. Create a Listing in the IAPHUB dashboard.

* Please follow [this guide](https://www.iaphub.com/docs/getting-started/create-listing) from IAPHUB to create the listing of products.

#### 15. Test in sandbox and switch to production

* Please follow [this guide](https://www.iaphub.com/docs/set-up-sdk/adalo-component/#sandbox-testing) for how to test in Sandbox mode and also switch your app purchases into production mode when ready.

{% hint style="info" %}
**NOTE:** Don't forget to complete the other steps in the [Adalo Publishing docs](https://help.adalo.com/~/revisions/kmzOxqjy7C9sXGVjDKKb/testing-your-app) to make your app available to users in the app stores!
{% endhint %}

## Learn More

* IAPHUB is working to make guides for consumable and non-consumable products as well!
* While you can test for free, IAPHUB is a paid service once you decide to switch to Production mode.
* Anyone that you want to test your purchasing flow on Android needs to be added as a license tester as show here:

<figure><img src="https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LhGHkPsv15svPIU5I7C%2Fuploads%2FmtwIwv0KvSlL0mlxNk1N%2FScreen%20Shot%202023-01-09%20at%204.40.51%20PM.png?alt=media&#x26;token=f303fda4-6994-4936-a849-cb88a89d5f0b" alt=""><figcaption></figcaption></figure>

## Help

Don't forget that if you experience an issue with this integration, be sure to check the [Apple Status](https://developer.apple.com/system-status/) page, the [Google Status](https://status.cloud.google.com/) page, and the [Adalo Status](https://status.adalo.com/) page to check for issues!

Adalo does not provide support for components developed by third parties, so the best place to reach out for support for IAPHUB is the IAPHUB team directly. You can do this through the bubble in the lower righthand corner of the IAPHUB dashboard. You can also check out their [troubleshooting](https://www.iaphub.com/docs/troubleshooting/product-not-returned) documentation.

If you need additional help with this article, you can always ask in our[ community forum](https://forum.adalo.com/)! Be sure to paste the link to this article in your post as well!<br>

Do you have a tutorial or help doc request? [Let us know!](https://ideas.adalo.com/tutorial-requests)
