|
| 1 | +--- |
| 2 | +slug: revenuecat |
| 3 | +title: RevenueCat |
| 4 | +tags: [] |
| 5 | +description: Learn how to integrate RevenueCat in your FlutterFlow app. |
| 6 | +sidebar_position: 1 |
| 7 | +--- |
| 8 | + |
| 9 | +# RevenueCat |
| 10 | + |
| 11 | +[RevenueCat](https://www.revenuecat.com/) simplifies implementing in-app purchases and subscriptions by handling all purchase validation operations. |
| 12 | + |
| 13 | +:::warning[Pub.Dev package and Limitations] |
| 14 | +The underlying package for RevenueCat does not support web. Any functionality related to in-app purchases or subscriptions managed through RevenueCat will not be available on web platforms. |
| 15 | +::: |
| 16 | + |
| 17 | +<div style={{ |
| 18 | + position: 'relative', |
| 19 | + paddingBottom: 'calc(56.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding |
| 20 | + height: 0, |
| 21 | + width: '100%'}}> |
| 22 | + <iframe |
| 23 | + src="https://demo.arcade.software/z3Fw57EiyR05PY6OPMG6?embed&show_copy_link=true" |
| 24 | + title="" |
| 25 | + style={{ |
| 26 | + position: 'absolute', |
| 27 | + top: 0, |
| 28 | + left: 0, |
| 29 | + width: '100%', |
| 30 | + height: '100%', |
| 31 | + colorScheme: 'light' |
| 32 | + }} |
| 33 | + frameborder="0" |
| 34 | + loading="lazy" |
| 35 | + webkitAllowFullScreen |
| 36 | + mozAllowFullScreen |
| 37 | + allowFullScreen |
| 38 | + allow="clipboard-write"> |
| 39 | + </iframe> |
| 40 | +</div> |
| 41 | +<p></p> |
| 42 | + |
| 43 | +Integrating the RevenueCat in your app comprises the following steps: |
| 44 | + |
| 45 | +1. [Setup RevenueCat](#1-setup-revenuecat) |
| 46 | +2. [Enable RevenueCat in FlutterFlow](#2-enable-revenuecat-in-flutterflow) |
| 47 | +3. [Retrieving in-app purchases and subscription details](#3-retrieving-in-app-purchases-and-subscription-details) |
| 48 | +4. [Add RevenueCat actions](#4-add-revenuecat-actions) |
| 49 | +5. [Testing](#5-testing) |
| 50 | +6. [Launch](#6-launch) |
| 51 | + |
| 52 | +## 1. Setup RevenueCat |
| 53 | + |
| 54 | +To set up the RevenueCat, follow these steps carefully: |
| 55 | + |
| 56 | +1. Sign up for a new RevenueCat account [here](https://app.revenuecat.com/). |
| 57 | +2. [Create a project](https://www.revenuecat.com/docs/getting-started/quickstart#%EF%B8%8F-create-a-project), [add your app](https://www.revenuecat.com/docs/getting-started/quickstart#%EF%B8%8F-add-an-app--platform), and ensure that you [add service credentials](https://www.revenuecat.com/docs/getting-started/quickstart#%EF%B8%8F-service-credentials) to help RevenueCat communicate with the app stores on your behalf. |
| 58 | +3. [Create subscriptions](https://www.revenuecat.com/docs/getting-started/quickstart#%EF%B8%8F-store-setup) in the respective stores. |
| 59 | + 1. While creating subscriptions in Google Play Console, if you see a message saying '***Your app doesn't have any in-app products yet**'* like in this picture, follow the steps below: |
| 60 | + <p></p> |
| 61 | +  |
| 62 | + |
| 63 | + 2. Return to FlutterFlow and navigate to **Settings & Integrations >** **In App Purchases & Subscriptions >** **RevenueCat**. |
| 64 | + |
| 65 | + 3. Switch on the **Enable RevenueCat**. For now, just enter any random string as your API Key (eg. `testkey`). We’ll update this later. |
| 66 | + |
| 67 | + 4. Now, from the toolbar menu, click **Download APK** |
| 68 | + |
| 69 | + 5. In the Play Console, create a [Closed testing](https://play.google.com/console/about/closed-testing/) track and create a new release. |
| 70 | + |
| 71 | + 6. Upload your **App Bundle** or **APK**, enter the release name, and create the release. |
| 72 | + |
| 73 | + 7. Open the **Subscriptions** tab again. It should let you manage subscriptions now. |
| 74 | +4. [Create Products and Entitlements in RevenueCat](https://www.revenuecat.com/docs/getting-started/quickstart#%EF%B8%8F-configure-products-and-entitlements-in-revenuecat). |
| 75 | + |
| 76 | +## 2. Enable RevenueCat in FlutterFlow |
| 77 | + |
| 78 | +To enable RevenueCat in FlutterFlow, follow the steps below: |
| 79 | + |
| 80 | +<div style={{ |
| 81 | + position: 'relative', |
| 82 | + paddingBottom: 'calc(56.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding |
| 83 | + height: 0, |
| 84 | + width: '100%'}}> |
| 85 | + <iframe |
| 86 | + src="https://demo.arcade.software/sKSpoidCReEDlikhUbs3?embed&show_copy_link=true" |
| 87 | + title="" |
| 88 | + style={{ |
| 89 | + position: 'absolute', |
| 90 | + top: 0, |
| 91 | + left: 0, |
| 92 | + width: '100%', |
| 93 | + height: '100%', |
| 94 | + colorScheme: 'light' |
| 95 | + }} |
| 96 | + frameborder="0" |
| 97 | + loading="lazy" |
| 98 | + webkitAllowFullScreen |
| 99 | + mozAllowFullScreen |
| 100 | + allowFullScreen |
| 101 | + allow="clipboard-write"> |
| 102 | + </iframe> |
| 103 | +</div> |
| 104 | +<p></p> |
| 105 | + |
| 106 | +## 3. Retrieving in-app purchases and subscription details |
| 107 | + |
| 108 | +To display the in-app purchases and subscription details, such as price, description, etc., inside the UI elements, you need to retrieve this information from RevenueCat. |
| 109 | + |
| 110 | +Here is an example of retrieving monthly subscription details: |
| 111 | + |
| 112 | +<div style={{ |
| 113 | + position: 'relative', |
| 114 | + paddingBottom: 'calc(56.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding |
| 115 | + height: 0, |
| 116 | + width: '100%'}}> |
| 117 | + <iframe |
| 118 | + src="https://demo.arcade.software/r5RpyXZaWp7n6DTikrHx?embed&show_copy_link=true" |
| 119 | + title="" |
| 120 | + style={{ |
| 121 | + position: 'absolute', |
| 122 | + top: 0, |
| 123 | + left: 0, |
| 124 | + width: '100%', |
| 125 | + height: '100%', |
| 126 | + colorScheme: 'light' |
| 127 | + }} |
| 128 | + frameborder="0" |
| 129 | + loading="lazy" |
| 130 | + webkitAllowFullScreen |
| 131 | + mozAllowFullScreen |
| 132 | + allowFullScreen |
| 133 | + allow="clipboard-write"> |
| 134 | + </iframe> |
| 135 | +</div> |
| 136 | +<p></p> |
| 137 | + |
| 138 | +## 4. Add RevenueCat actions |
| 139 | + |
| 140 | +To manage in-app purchases and subscriptions inside your FlutterFlow app, you have to use the RevenueCat Actions. Below are the types of RevenueCat actions: |
| 141 | + |
| 142 | +- **Paywall** |
| 143 | +- **Purchase** |
| 144 | +- **Restore Purchases** |
| 145 | + |
| 146 | +### Paywall [Action] |
| 147 | + |
| 148 | +This action checks whether a user has purchased an item. If not, you can open the Paywall (asking to buy an item or purchase a subscription). |
| 149 | + |
| 150 | +Follow the steps below to see if a user is subscribed and take action accordingly. |
| 151 | + |
| 152 | +<div style={{ |
| 153 | + position: 'relative', |
| 154 | + paddingBottom: 'calc(56.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding |
| 155 | + height: 0, |
| 156 | + width: '100%'}}> |
| 157 | + <iframe |
| 158 | + src="https://demo.arcade.software/0m0oeM9PRbe7e5JbapCf?embed&show_copy_link=true" |
| 159 | + title="" |
| 160 | + style={{ |
| 161 | + position: 'absolute', |
| 162 | + top: 0, |
| 163 | + left: 0, |
| 164 | + width: '100%', |
| 165 | + height: '100%', |
| 166 | + colorScheme: 'light' |
| 167 | + }} |
| 168 | + frameborder="0" |
| 169 | + loading="lazy" |
| 170 | + webkitAllowFullScreen |
| 171 | + mozAllowFullScreen |
| 172 | + allowFullScreen |
| 173 | + allow="clipboard-write"> |
| 174 | + </iframe> |
| 175 | +</div> |
| 176 | +<p></p> |
| 177 | + |
| 178 | +### Purchase [Action] |
| 179 | + |
| 180 | +This action allows you to purchase the item. Here’s how you add it: |
| 181 | + |
| 182 | +<div style={{ |
| 183 | + position: 'relative', |
| 184 | + paddingBottom: 'calc(56.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding |
| 185 | + height: 0, |
| 186 | + width: '100%'}}> |
| 187 | + <iframe |
| 188 | + src="https://demo.arcade.software/95HnVG5vM9J7gi73vjxW?embed&show_copy_link=true" |
| 189 | + title="" |
| 190 | + style={{ |
| 191 | + position: 'absolute', |
| 192 | + top: 0, |
| 193 | + left: 0, |
| 194 | + width: '100%', |
| 195 | + height: '100%', |
| 196 | + colorScheme: 'light' |
| 197 | + }} |
| 198 | + frameborder="0" |
| 199 | + loading="lazy" |
| 200 | + webkitAllowFullScreen |
| 201 | + mozAllowFullScreen |
| 202 | + allowFullScreen |
| 203 | + allow="clipboard-write"> |
| 204 | + </iframe> |
| 205 | +</div> |
| 206 | +<p></p> |
| 207 | + |
| 208 | +### Restore Purchases [Action] |
| 209 | + |
| 210 | +Using this action, you can allow users to re-activate the subscription they have already paid for. This is helpful when a user has reinstalled the app or logged in to a new device. |
| 211 | + |
| 212 | +:::info |
| 213 | + |
| 214 | +- A good practice is to allow users to manually restore the purchase by showing a button or text (maybe on a paywall/settings page). |
| 215 | +- If you provide this option, please check [**How RevenueCat should respond to restore behavior**](https://www.revenuecat.com/docs/restoring-purchases#restore-behavior). |
| 216 | + |
| 217 | +::: |
| 218 | + |
| 219 | +<figure> |
| 220 | +  |
| 221 | + <figcaption class="centered-caption">Adding action to restore purchase</figcaption> |
| 222 | +</figure> |
| 223 | + |
| 224 | + |
| 225 | +## 5. Testing |
| 226 | + |
| 227 | +You can test your subscriptions using sandbox environments, which simulate real store behavior without incurring costs. [This document](https://www.revenuecat.com/docs/test-and-launch/sandbox) provides detailed guidelines for testing purchases on [Android](https://www.revenuecat.com/docs/test-and-launch/sandbox/google-play-store) and [iOS devices](https://www.revenuecat.com/docs/test-and-launch/sandbox/apple-app-store). |
| 228 | + |
| 229 | +## 6. Launch |
| 230 | + |
| 231 | +Before launching your app to production make sure you go through the **Launch Checklist** of RevenueCat: |
| 232 | + |
| 233 | +[In-App Purchase Launch Checklist – RevenueCatRevenueCat](https://docs.revenuecat.com/docs/launch-checklist) |
| 234 | + |
| 235 | +## FAQs |
| 236 | + |
| 237 | +<details> |
| 238 | +<summary>I don't see offerings or products</summary> |
| 239 | +<p> |
| 240 | +If you're testing in the sandbox and the products are not retrieved from Apple/Google, it's likely a configuration issue. To resolve this, ensure the following: |
| 241 | + |
| 242 | +1. The product identifier set in RevenueCat matches exactly with the store. |
| 243 | +2. You're testing on a physical device and not a simulator. |
| 244 | +3. The bundle ID in Xcode [iOS] or package name [Google] matches what's in App Store Connect or Google Play Developer console. |
| 245 | + |
| 246 | +For iOS only, ensure that products are in the 'Ready To Submit' or 'Approved' state, you've signed your 'Paid Applications Agreement', and you're not using a StoreKit Configuration file. |
| 247 | + |
| 248 | +For Google only, ensure that the subscription product is in the Active state, your app is published on a closed track, and you've added a tester. |
| 249 | + |
| 250 | +See more details [here](https://community.revenuecat.com/sdks-51/why-are-offerings-or-products-empty-124). |
| 251 | +</p> |
| 252 | +</details> |
| 253 | + |
0 commit comments