-
Notifications
You must be signed in to change notification settings - Fork 317
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PaywallsTester: allow for configuration for demos (#3260)
This introduces buttons that allow you to reconfigure the app with a different API key. This will be useful when doing demos for customers, since the Testing app's Offerings are pretty cluttered at this point. <img width="447" alt="image" src="https://github.com/RevenueCat/purchases-ios/assets/3922667/c603f289-4e5e-45fd-b725-a76b552f4fde">
- Loading branch information
Showing
4 changed files
with
139 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 9 additions & 5 deletions
14
Tests/TestingApps/PaywallsTester/ci_scripts/ci_pre_xcodebuild.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
#!/bin/bash -e | ||
|
||
PAYWALLS_TESTER_API_KEY=$REVENUECAT_XCODE_CLOUD_SIMPLE_APP_API_KEY | ||
PAYWALLS_TESTER_API_KEY_FOR_TESTING=$REVENUECAT_XCODE_CLOUD_SIMPLE_APP_API_KEY_FOR_TESTING | ||
PAYWALLS_TESTER_API_KEY_FOR_DEMOS=$REVENUECAT_XCODE_CLOUD_SIMPLE_APP_API_KEY_FOR_DEMOS | ||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
|
||
if [ -z "$PAYWALLS_TESTER_API_KEY" ]; then | ||
echo "PaywallsTester API key environment variable is not set." | ||
if [ -z "$PAYWALLS_TESTER_API_KEY_FOR_TESTING" ]; then | ||
echo "PaywallsTester API key for testing environment variable is not set." | ||
elif [ -z "$PAYWALLS_TESTER_API_KEY_FOR_DEMOS" ]; then | ||
echo "PaywallsTester API key for demos environment variable is not set." | ||
else | ||
echo "Replacing API key on PaywallsTester" | ||
echo "Replacing API keys on PaywallsTester" | ||
|
||
file="$SCRIPT_DIR/../PaywallsTester/Configuration.swift" | ||
sed -i.bak 's/private static let apiKeyFromCI = ""/private static let apiKeyFromCI = "'$PAYWALLS_TESTER_API_KEY'"/g' $file | ||
sed -i.bak 's/private static let apiKeyFromCIForTesting = ""/private static let apiKeyFromCIForTesting = "'$PAYWALLS_TESTER_API_KEY_FOR_TESTING'"/g' $file | ||
sed -i.bak 's/private static let apiKeyFromCIForDemos = ""/private static let apiKeyFromCIForDemos = "'$PAYWALLS_TESTER_API_KEY_FOR_DEMOS'"/g' $file | ||
rm $file.bak | ||
fi |