File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
Examples/FriendlyFlix/app/FriendlyFlix
FriendlyFlix.xcodeproj/xcshareddata/xcschemes Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 5050 ReferencedContainer = " container:FriendlyFlix.xcodeproj" >
5151 </BuildableReference >
5252 </BuildableProductRunnable >
53+ <CommandLineArguments >
54+ <CommandLineArgument
55+ argument = " -useEmulator YES"
56+ isEnabled = " YES" >
57+ </CommandLineArgument >
58+ </CommandLineArguments >
5359 </LaunchAction >
5460 <ProfileAction
5561 buildConfiguration = " Release"
Original file line number Diff line number Diff line change @@ -17,13 +17,29 @@ import FirebaseAuth
1717import FirebaseDataConnect
1818import FriendlyFlixSDK
1919import SwiftUI
20+ import os
2021
2122@main
2223struct FriendlyFlixApp : App {
24+ private let logger = Logger ( subsystem: " FriendlyFlix " , category: " configuration " )
25+
2326 var authenticationService : AuthenticationService ?
2427
28+ /// Determines whether to use the Firebase Local Emulator Suite.
29+ /// To use the local emulator, go to the active scheme, and add `-useEmulator YES`
30+ /// to the _Arguments Passed On Launch_ section.
31+ public var useEmulator : Bool {
32+ let value = UserDefaults . standard. bool ( forKey: " useEmulator " )
33+ logger. log ( " Using the emulator: \( value == true ? " YES " : " NO " ) " )
34+ return value
35+ }
36+
2537 init ( ) {
2638 FirebaseApp . configure ( )
39+ if useEmulator {
40+ DataConnect . friendlyFlixConnector. useEmulator ( port: 9399 )
41+ Auth . auth ( ) . useEmulator ( withHost: " localhost " , port: 9099 )
42+ }
2743
2844 authenticationService = AuthenticationService ( )
2945 authenticationService? . onSignUp { user in
You can’t perform that action at this time.
0 commit comments