-
Notifications
You must be signed in to change notification settings - Fork 316
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
PaywallsTester: allow for configuration for demos #3260
Changes from all commits
0d3f577
8551647
c1a905b
d188caa
60178f6
51490ba
8cf27f9
45bddac
04e5623
1005525
028b379
82777b5
3a1ef34
5b261a7
d7701ce
6a6f624
8d535be
55cda38
b1fbb92
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,36 +5,15 @@ | |
// Created by Nacho Soto on 5/30/23. | ||
// | ||
|
||
import RevenueCat | ||
import RevenueCatUI | ||
import SwiftUI | ||
|
||
@main | ||
struct SimpleApp: App { | ||
|
||
init() { | ||
Purchases.logLevel = .verbose | ||
Purchases.proxyURL = Configuration.proxyURL.isEmpty | ||
? nil | ||
: URL(string: Configuration.proxyURL)! | ||
|
||
Purchases.configure( | ||
with: .init(withAPIKey: Configuration.effectiveApiKey) | ||
.with(entitlementVerificationMode: .informational) | ||
.with(usesStoreKit2IfAvailable: true) | ||
) | ||
} | ||
|
||
var body: some Scene { | ||
WindowGroup { | ||
AppContentView( | ||
customerInfoStream: Self.apiKeyIsConfigured | ||
? Purchases.shared.customerInfoStream | ||
: nil | ||
) | ||
AppContentView() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated so that it uses the |
||
} | ||
} | ||
|
||
private static let apiKeyIsConfigured = !Configuration.effectiveApiKey.isEmpty | ||
|
||
} |
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added another 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 |
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 nice