File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -46,9 +46,13 @@ public class FirebaseDestination: DestinationPlugin {
4646 public let type = PluginType . destination
4747 public let key = " Firebase "
4848 public var analytics : Segment . Analytics ? = nil
49-
50- public init ( ) { }
51-
49+
50+ private var firebaseOptions : FirebaseOptions ? = nil
51+
52+ public init ( firebaseOptions: FirebaseOptions ? = nil ) {
53+ self . firebaseOptions = firebaseOptions
54+ }
55+
5256 public func update( settings: Settings , type: UpdateType ) {
5357 // we've already set up this singleton SDK, can't do it again, so skip.
5458 guard type == . initial else { return }
@@ -63,7 +67,11 @@ public class FirebaseDestination: DestinationPlugin {
6367 if ( FirebaseApp . app ( ) != nil ) {
6468 analytics? . log ( message: " Firebase already configured, skipping " )
6569 } else {
66- FirebaseApp . configure ( )
70+ if let options = firebaseOptions {
71+ FirebaseApp . configure ( options: options)
72+ } else {
73+ FirebaseApp . configure ( )
74+ }
6775 }
6876 }
6977
You can’t perform that action at this time.
0 commit comments