-
Notifications
You must be signed in to change notification settings - Fork 338
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
Use RC API key for local development from local.xcconfig #4795
Changes from all commits
d7df3b1
ad98051
6e2b52e
81c87b7
d526b47
72a74b8
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 | ||||
---|---|---|---|---|---|---|
|
@@ -7,17 +7,18 @@ | |||||
|
||||||
import Foundation | ||||||
|
||||||
protocol AvailableConfigItems { | ||||||
static var apiKey: String { get } | ||||||
static var proxyURL: String? { get } | ||||||
} | ||||||
|
||||||
// CI system adds keys here | ||||||
extension AvailableConfigItems { | ||||||
static var apiKey: String { "" } | ||||||
static var proxyURL: String? { nil } | ||||||
} | ||||||
|
||||||
struct ConfigItem: AvailableConfigItems { | ||||||
// DO NOT MODIFY THIS FILE. | ||||||
// CI system adds the API key here. | ||||||
struct ConfigItem { | ||||||
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. nit
Suggested change
|
||||||
/* | ||||||
To add your own API key for local development, add it in your local.xcconfig file like this: | ||||||
REVENUECAT_API_KEY = your-api-key | ||||||
*/ | ||||||
static var apiKey: String { Bundle.main.object(forInfoDictionaryKey: "REVENUECAT_API_KEY") as? String ?? "" } | ||||||
|
||||||
/* | ||||||
To add your own proxyURL for local development, add it in your local.xcconfig file like this: | ||||||
REVENUECAT_PROXY_URL = your-api-key | ||||||
*/ | ||||||
static var proxyURL: String? { Bundle.main.object(forInfoDictionaryKey: "REVENUECAT_PROXY_URL") as? String } | ||||||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>REVENUECAT_API_KEY</key> | ||
<string>$(REVENUECAT_API_KEY)</string> | ||
</dict> | ||
</plist> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,7 +38,7 @@ verify_no_included_apikeys() { | |
"${SCRIPT_DIR}/../Examples/MagicWeather/MagicWeather/Constants.swift" | ||
"${SCRIPT_DIR}/../Examples/MagicWeatherSwiftUI/Shared/Constants.swift" | ||
"${SCRIPT_DIR}/../Tests/TestingApps/PurchaseTesterSwiftUI/Core/Constants.swift" | ||
"${SCRIPT_DIR}/../Tests/TestingApps/PaywallsTester/PaywallsTester/Config/LocalConfigItems.swift" | ||
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. Can we not get rid of all of these files, so we can get rid of the entire 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. Well I see the utility of having then in the sense that someone might forget about the |
||
"${SCRIPT_DIR}/../Tests/TestingApps/PaywallsTester/PaywallsTester/Config/ConfigItem.swift" | ||
) | ||
FILES_STAGED=$(git diff --cached --name-only) | ||
PATTERN="\"REVENUECAT_API_KEY\"" | ||
|
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.
What do you think about removing this file and making the CI script create a
Local.xcconfig
file instead?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.
Well, this file is still needed for the PaywallsTester app. I mean, not needed per se, but it's good to have a centralized place where we get the necessary variables from the info.plist.
Regarding having the CI script create a Local.xcconfig, I think that could totally work, yes. I'll open a separate PR for the CI changes related to this one 👍