-
Notifications
You must be signed in to change notification settings - Fork 382
Crash on release when using a Test Store API key #5453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah, good point, this looks good!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good one!
#else | ||
// In release builds, we intentionally crash to prevent submitting an app with a Test Store API key | ||
fatalError("[RevenueCat]: Test Store API key used in RELEASE build." + | ||
"Please configure a valid API key before releasing.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we guide the dev a bit more? Maybe:
"Please configure a valid API key before releasing.") | |
"Please configure the App Store app on the RevenueCat dashboard and use its corresponding Apple API key before releasing.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it! yes, it's much clearer this way 👌 Thanks!!
Done in 9257137
📸 Snapshot Test1 modified, 704 unchanged
🛸 Powered by Emerge Tools |
### Description Android equivalent of RevenueCat/purchases-ios#5453 This PR introduces a crash at runtime if the app is running on release (on a debuggable process) when configuring the SDK with a Test Store API Key. Debug builds are unaffected. --------- Co-authored-by: Antonio Pallares <ajpallares@users.noreply.github.com>
### Description Android equivalent of RevenueCat/purchases-ios#5453 This PR introduces a crash at runtime if the app is running on release (on a debuggable process) when configuring the SDK with a Test Store API Key. Debug builds are unaffected. --------- Co-authored-by: Antonio Pallares <ajpallares@users.noreply.github.com>
Motivation
Using a Test Store API Key in production will result in apps being submitted to the App Store without proper in-app purchase configuration. This would lead to a broken user experience, no proceeds being made from IAPs and, very likely, to the rejection of the app. We want to ensure these builds are caught early and prevented from reaching review.
Description
This PR introduces a crash at runtime if the app is running a Release build when configuring the SDK with a Test Store API Key. Debug builds are unaffected.
Important: XCFramework support
When the SDK is distributed as an XCFramework (binary compiled with Release configuration), the client app’s
DEBUG
compiler flag isn’t propagated into the binary. As a result, any build—including those intended as “development” when integrated via XCFramework—will crash if a Test Store API Key is used.This means that developing with a Test Store API key isn’t supported when adding the SDK dependency as an XCFramework.