Native RevenueCat integration for Godot Engine with full support for iOS and Android.
- Overview
- Quick Start
- Usage Examples
- Advanced Configuration
- Building (For Developers)
- Project Structure
- Development Guide
- Troubleshooting
- API Reference
- FAQ
- Contributing
- Screenshot
- License
This project provides a native RevenueCat plugin for Godot, built as a fully integrated purchase and subscription management system using the official RevenueCat SDK. The plugin is shipped as native libraries for iOS (.xcframework) and Android (.aar) and automatically managed through the Godot Export Pipeline.
- 💰 Purchases & Subscriptions – Easily handle consumables, non‑consumables, and subscription products
- 🧩 Entitlements & Customer Info – Query whether a user is premium and access entitlement statuses
- 📦 Offerings & Products – Retrieve RevenueCat products dynamically and build custom paywalls
- 🧱 Native Paywall UI – Show RevenueCat UI using
present_paywall(iOS + Android) - 🔑 User Authentication – Login, logout, restore purchases and support cross‑platform accounts
| Component | Version |
|---|---|
| Godot | 4.5‑stable |
| RevenueCat iOS SDK | 5.54.0 |
| RevenueCat Android SDK | 9.19.0 |
| Kotlin | 2.3.0 |
| Min iOS | 15.0 |
| Min Android SDK | 24 (Android 7.0) |
- Open AssetLib in Godot Editor
- Search for "Godotx RevenueCat"
- Click Download and Install
- Or download directly from: https://godotengine.org/asset-library/asset/4493
-
Download the ZIP from Releases
-
Extract the ZIP - it contains 3 folders:
godotx_revenuecat/ ├── addons/ ├── ios/ └── android/ -
Copy all 3 folders to your Godot project root:
your_project/ ├── addons/ │ └── godotx_revenue_cat/ ├── ios/ │ └── plugins/ │ └── revenuecat/ └── android/ └── revenuecat/ -
Enable the plugin in Godot:
- Open Project → Project Settings → Plugins
- Enable "Godotx RevenueCat"
-
Install Android Build Template
Project → Install Android Build Template -
In the export menu, set:
- ✔ Use Gradle Build
- ✔ Enable GodotxRevenueCat in plugins list
Enable plugin under export → iOS plugins list.
extends Node
var revenuecat
func _ready():
if Engine.has_singleton("GodotxRevenueCat"):
revenuecat = Engine.get_singleton("GodotxRevenueCat")
# Signals
revenuecat.customer_info_changed.connect(_on_customer_info_changed)
revenuecat.purchase_result.connect(_on_purchase_result)
var api_key = OS.get_name() == "iOS" ? "appl_xxx" : "goog_xxx"
revenuecat.initialize(api_key, "", true)
func _on_customer_info_changed(data):
print("Customer info updated: ", data)
func _on_purchase_result(data):
print("Purchase result: ", data)# Offerings
revenuecat.fetch_offerings()
# Products (for custom UI)
revenuecat.fetch_products(["premium_monthly", "premium_yearly"])revenuecat.purchase("premium_monthly")revenuecat.restore_purchases()revenuecat.present_paywall("default")revenuecat.is_subscriber()
revenuecat.has_entitlement("premium_access")
revenuecat.check_entitlement("premium_access")revenuecat.login("user_123")
revenuecat.logout()By default, R8 minification is disabled in release builds. If you want to enable it for smaller APK/AAB sizes, follow these steps:
-
Edit
android/build/build.gradleand enable minification in the release build type:android { buildTypes { release { minifyEnabled true shrinkResources true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } }
-
Create
android/build/proguard-rules.prowith the following content:#################################### # Godot JNI #################################### -keep class org.godotengine.godot.** { *; } -dontwarn org.godotengine.godot.**
Important Notes:
- RevenueCat ProGuard rules are already included in the module (via
consumerProguardFiles) - Only add custom rules if you encounter issues with other libraries
- Test thoroughly after enabling minification to ensure everything works correctly
make setup # Downloads SDKs & prepares build
make build-all # Builds everything
make build-apple # Build only iOS
make build-android # Build only Android
make clean # Full cleanuprevenuecat/
├── addons/godotx_revenue_cat/ # Godot plugin
│ ├── export_plugin.gd
│ └── plugin.cfg
│
├── source/ # Native source
│ ├── ios/
│ └── android/
│
├── ios/plugins/ # Built output (.xcframework)
├── android/ # Built output (.aar)
└── scenes/Main.tscn # Test scene
| Method | Description |
|---|---|
initialize(api_key, user_id, debug) |
Initializes SDK |
fetch_offerings() |
Retrieves offerings |
fetch_products(ids) |
Retrieves product details |
purchase(id) |
Starts purchase flow |
login(user_id) |
Authenticate user |
logout() |
Anonymous reset |
is_subscriber() |
Returns subscription state |
has_entitlement(id) |
Returns if has entitlement |
present_paywall(offering) |
Shows native UI |
check_entitlement(id) |
Checks entitlement |
restore_purchases |
Retrieves purchases |
| Signal | Args | Description |
|---|---|---|
customer_info_changed |
data: Dictionary |
On customer update |
purchase_result |
data: Dictionary |
On purchase finish |
offerings |
data: Dictionary |
Offerings received |
products |
items: Array |
Products received |
login_finished |
data: Dictionary |
Login status |
logout_finished |
data: Dictionary |
Logout |
subscriber |
value: bool |
Subscription flag |
entitlement |
id, active |
Entitlement result |
paywall_result |
data: Dictionary |
Paywall close |
restore_result |
data: Dictionary |
Restore result |
Q: Do I need separate keys for Android/iOS?
Yes — use appl_ for iOS and goog_ for Android.
Contributions are welcome! Here's how you can help:
- Report bugs: Open an issue with reproduction steps
- Request features: Suggest new features or improvements
- Submit PRs:
- Follow existing code style
- Test on both iOS and Android
- Update documentation as needed
- iOS: Objective-C++ for Godot integration
- Android: Kotlin for plugin implementation
- Naming:
GodotxRevenueCatfor singleton names - Signals: Use snake_case (e.g.,
purchase_result,initialized) - Methods: Use snake_case following GDScript conventions
MIT License - See LICENSE
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Made with ❤️ by Paulo Coutinho
