File tree 1 file changed +12
-4
lines changed 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 {
46
46
public let type = PluginType . destination
47
47
public let key = " Firebase "
48
48
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
+
52
56
public func update( settings: Settings , type: UpdateType ) {
53
57
// we've already set up this singleton SDK, can't do it again, so skip.
54
58
guard type == . initial else { return }
@@ -63,7 +67,11 @@ public class FirebaseDestination: DestinationPlugin {
63
67
if ( FirebaseApp . app ( ) != nil ) {
64
68
analytics? . log ( message: " Firebase already configured, skipping " )
65
69
} else {
66
- FirebaseApp . configure ( )
70
+ if let options = firebaseOptions {
71
+ FirebaseApp . configure ( options: options)
72
+ } else {
73
+ FirebaseApp . configure ( )
74
+ }
67
75
}
68
76
}
69
77
You can’t perform that action at this time.
0 commit comments