Build With RevenueCat

Build a customized mobile subscription business with RevenueCat. We do the heavy lifting of normalizing subscribers from any source and maintain a single source of truth for subscription status, so you can get back to building your app.

RevenueCat is a powerful, secure, reliable, and free to use in-app purchase server with global support. All you need to get started is an API key.

Get Started    REST API Endpoints

Debugging

View and understand Purchases logs

👍

This section assumes you've followed our Quickstart section of our Getting Started guide to install and configure our SDK.

Debugging

Purchases will log important information and errors to help you understand what is going on behind the scenes. You can enable more detailed debug logs with the debugLogsEnabled flag. You can set this immediately in your app while testing, before you configure Purchases.

Purchases.debugLogsEnabled = true
Purchases.configure(withAPIKey: "public_sdk_key", appUserID: "my_app_user_id")
RCPurchases.debugLogsEnabled = YES;
[RCPurchases configureWithAPIKey:@"public_sdk_key" appUserID:@"my_app_user_id"];
Purchases.debugLogsEnabled = true
Purchases.configure(this, "public_sdk_key", "my_app_user_id")
Purchases.setDebugLogsEnabled(true);
Purchases.configure(this, "public_sdk_key", "my_app_user_id");
Purchases.setDebugLogsEnabled(true);
Purchases.setup("public_sdk_key", "my_app_user_id");
await Purchases.setDebugLogsEnabled(true);
await Purchases.setup("public_sdk_key", "my_app_user_id");
Purchases.SetDebugLogsEnabled(true);

📘

OS_ACTIVITY_MODE and Common iOS Issues

On iOS, disabling OS_ACTIVITY_MODE in your Xcode scheme will block debug logs from printing in the console. If you have debug logs enabled, but don't see any output, go to Product -> Scheme -> Edit Scheme... in Xcode and uncheck the OS_ACTIVITY_MODE environment variable.

Flutter projects using Swift may fail to show debug logs in the console if you are using Visual Studio Code, Android Studio, or other IDE's to run your project. We recommend running your Flutter project using Xcode to view debug logs from the Purchases SDK.

Filtering Purchases Logs

All logs from Purchases SDK are prepended with "[Purchases]", you can use this string as a filter in your log output to clearly see the logs that are from Purchases.

Debug Logs Legend

Emojis currently available on the following platforms:

  • Android version >= 4.0.2
  • iOS version >= 3.10.1
    Support for other platforms coming soon.

Icon(s)

Log Level

Description

Required Actions

🍎 :bangbang:

Error
Warn

Error/warning messages generated from Apple

View error handling doc if on Error level

🤖 :bangbang:

Error
Warn

Error/warning messages generated from Google

View error handling doc if on Error level

😿 :bangbang:

Error

Error messages generated from RevenueCat

View error handling doc

😻

Debug

Success messages generated from RevenueCat

No action required, for informational purposes.

😻💰

Info

RevenueCat received purchase information

No action required, for informational purposes.

💰

Debug

Messages related to your products

No action required, for informational purposes.

ℹ️

Debug
Info

Messages detailing events that occur in your app cycle

No action required, for informational purposes.

👤

Debug

Messages related to a user's App User ID

No action required, for informational purposes.

:warning:

Warn

Warning messages about implementation

View log message for additional information.

Messages that have the double red exclamation marks prefix (:bangbang:) attached provides important information regarding your implementation and may require your attention. Paying attention to the source of the message will assist you during the development process. Be sure to address these logs before shipping your app.

Sample Output

Below are sample logs generated when setting debugLogsEnabled = true. Keep an eye out for any ERROR level logs, status codes other than 200, or any Invalid Product Identifiers.

[Purchases] - DEBUG: Debug logging enabled.
[Purchases] - DEBUG: SDK Version - 2.0.0
[Purchases] - DEBUG: Initial App User ID - <APP_USER_ID>
[Purchases] - DEBUG: Changing App User ID: (null) -> <APP_USER_ID>
[Purchases] - DEBUG: GET /v1/subscribers/<APP_USER_ID>
[Purchases] - DEBUG: GET /v1/subscribers/<APP_USER_ID>/products
[Purchases] - DEBUG: Delegate set
[Purchases] - DEBUG: Sending latest purchaser info to delegate
[Purchases] - DEBUG: Vending purchaserInfo from cache
[Purchases] - DEBUG: Vending purchaserInfo from cache
[Purchases] - DEBUG: applicationDidBecomeActive
[Purchases] - DEBUG: No cached entitlements, fetching
[Purchases] - DEBUG: GET /v1/subscribers/<APP_USER_ID> 200
[Purchases] - DEBUG: Purchaser info updated, sending to delegate
[Purchases] - DEBUG: GET /v1/subscribers/<APP_USER_ID>/products 200
[Purchases] - DEBUG: Requesting products with identifiers: {(
    onetime,
    annual,
    onemonth
)}
[Purchases] - DEBUG: Products request finished
[Purchases] - DEBUG: Valid Products:
[Purchases] - DEBUG: annual - <SKProduct: 0x600000308980>
[Purchases] - DEBUG: onemonth - <SKProduct: 0x6000003131b0>
[Purchases] - DEBUG: onetime - <SKProduct: 0x600000313180>
[Purchases] - DEBUG: Invalid Product Identifiers - (
)
[Purchases] - DEBUG: 2 completion handlers waiting on products
[Purchases] - DEBUG: makePurchase - onemonth
[Purchases] - DEBUG: PaymentQueue updatedTransaction: onemonth (null) ((null)) - 0
[Purchases] - DEBUG: PaymentQueue updatedTransaction: onemonth <TRANSACTION_ID> ((null)) - 2
[Purchases] - DEBUG: Finishing onemonth <TRANSACTION_ID> ((null))
[Purchases] - DEBUG: PaymentQueue removedTransaction: onemonth <TRANSACTION_ID> ((null)) - 2
[Purchases] - DEBUG: ℹ️ Debug logging enabled
[Purchases] - DEBUG: ℹ️ SDK Version - 3.10.1
[Purchases] - DEBUG: 👤 Initial App User ID - <APP_USER_ID>
[Purchases] - DEBUG: ℹ️ PurchaserInfo cache is stale, updating caches
[Purchases] - DEBUG: ℹ️ Offerings cache is stale, updating caches
[Purchases] - DEBUG: ℹ️ Vending PurchaserInfo from cache.
[Purchases] - DEBUG: ℹ️ There are no requests currently running, starting request GET /subscribers/<APP_UESR_ID>
[Purchases] - DEBUG: ℹ️ API request started: GET /v1/subscribers/<APP_UESR_ID>
[Purchases] - DEBUG: ℹ️ API request started: GET /v1/subscribers/<APP_UESR_ID>/offerings
[Purchases] - DEBUG: ℹ️ No cached Offerings, fetching from network
[Purchases] - DEBUG: ℹ️ API request completed with status: GET /v1/subscribers/<APP_UESR_ID>/offerings 200
[Purchases] - DEBUG: ℹ️ Requesting products from the store with identifiers: {(
    onetime,
    annual,
    onemonth
)}
[Purchases] - DEBUG: ℹ️ Products request finished.
[Purchases] - DEBUG: 💰 Retrieved SKProducts: 
[Purchases] - DEBUG: 💰 onetime - <SKProduct: 0x600000308980>
[Purchases] - DEBUG: 💰 annual - <SKProduct: 0x600000308980>
[Purchases] - DEBUG: 💰 onemonth - <SKProduct: 0x600000308980>
[Purchases] - WARN: 🍎‼️ Invalid Product Identifiers - (
)
[Purchases] - DEBUG: ℹ️ 3 completion handlers waiting on products
[Purchases] - DEBUG: ℹ️ makePurchase
[Purchases] - DEBUG: 💰 Purchasing product from package  - annual in Offering main
[Purchases] - DEBUG: ℹ️ PaymentQueue updatedTransaction: annual <TRANSACTION_ID> ((null)) (null) - 0

[Purchases] - DEBUG: 💰 Finishing transaction annual <TRANSACTION_ID> ((null))
[Purchases] - DEBUG: ℹ️ PaymentQueue removedTransaction: annual <TRANSACTION_ID> (null (null)) (null) - 1

Next Steps

Updated about a month ago


Debugging


View and understand Purchases logs

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.