@@ -100,8 +100,8 @@ public protocol AppDelegateViewModelOutputs {
100100 /// Emits when the application should configure Segment with an instance of Braze.
101101 var configureSegmentWithBraze : Signal < String , Never > { get }
102102
103- /// Emits when the application should configure Statsig.
104- var configureStatsig : Signal < ( ) , Never > { get }
103+ /// Emits when the application should configure Statsig and returns the correct API Key .
104+ var configureStatsig : Signal < String , Never > { get }
105105
106106 /// Return this value in the delegate method.
107107 var continueUserActivityReturnValue : MutableProperty < Bool > { get }
@@ -721,6 +721,11 @@ public final class AppDelegateViewModel: AppDelegateViewModelType, AppDelegateVi
721721 self . configureFirebase = self . applicationLaunchOptionsProperty. signal. ignoreValues ( )
722722
723723 self . configureStatsig = self . applicationLaunchOptionsProperty. signal. ignoreValues ( )
724+ . map { _ in
725+ AppEnvironment . current. mainBundle. isRelease
726+ ? Secrets . Statsig. production
727+ : Secrets . Statsig. staging
728+ }
724729
725730 self . setApplicationShortcutItems = currentUserEvent
726731 . values ( )
@@ -927,7 +932,7 @@ public final class AppDelegateViewModel: AppDelegateViewModelType, AppDelegateVi
927932 public let applicationIconBadgeNumber : Signal < Int , Never >
928933 public let configureFirebase : Signal < ( ) , Never >
929934 public let configureSegmentWithBraze : Signal < String , Never >
930- public let configureStatsig : Signal < ( ) , Never >
935+ public let configureStatsig : Signal < String , Never >
931936 public let continueUserActivityReturnValue = MutableProperty ( false )
932937 public let emailVerificationCompleted : Signal < ( String , Bool ) , Never >
933938 public let findRedirectUrl : Signal < URL , Never >
0 commit comments