@main
struct ABTestingExampleApp: Appmain point of entry into app
var appConfig: AppConfigstores the AppConfig instance
init()configures the FirebaseApp, configures RemoteConfig, and initializes AppConfig instance
var body: some Scenereturns a WindowGroup containing a ContentView with appConfig passed in
class AppConfig: ObservableObjecthandles communication with RemoteConfig and updating the UI
@Published var colorScheme: ColorSchemestores the color scheme for the app
init()updates app's color scheme from RemoteConfig and adds observer to print installation auth token if it changes on platforms other than Mac Catalyst
deinitremoves installation auth token change observer on platforms other than Mac Catalyst
func updateFromRemoteConfig()retrieves color scheme from RemoteConfig and updates app's color scheme on the main thread if it has changed
@available(iOS 15, tvOS 15, macOS 12, watchOS 8, *)
func updateFromRemoteConfigAsync() asyncretrieves color scheme from RemoteConfig asynchronously and updates app's color scheme on the main thread if it has changed
@objc func printInstallationAuthToken()prints installation auth token on platforms other than Mac Catalyst
extension ColorSchemeextends ColorScheme to deal with String initializer
init(_ value: String)returns the corresponding ColorScheme, defaulting to light otherwise
extension RemoteConfigFetchAndActivateStatusextends RemoteConfigFetchAndActivateStatus with debug description
var debugDescription: String { get }prints String representation of status
struct ContentView: Viewmain content view
@ObservedObject var appConfig: AppConfigstores app's AppConfig instance
var body: some View { get }returns a FirebaseList wrapped with NavigationView when not on macOS
struct FirebaseList: Viewmulti-platform view for a BasicList populated with Firebase data
@ObservedObject var appConfig: AppConfigstores app's AppConfig instance
let data: [(title: String, subtitle: String)]stores array of title-subtitle String pairings specific to Firebase
var body: some View { get }returns VStack containing a BasicList populated with the Firebase data on top of a "Refresh"
Button, which updates appConfig's color scheme from Remote Config and is done asynchronously if
refreshed by pulling down on the list on iOS 15, with a navigation title of "Firenotes", preferred
color scheme of appConfig's color scheme, and foreground color corresponding to appConfig's color
scheme (orange for dark color scheme, primary for light color scheme)
struct BasicList: Viewview for a basic list of title-subtitle String pairings
let data: [(title: String, subtitle: String)]stores array of title-subtitle String pairings
var body: some View { get }returns List of VStacks each containing a Text title on top of a Text subtitle derived from
data