-
Notifications
You must be signed in to change notification settings - Fork 4k
/
firebase_options.dart
174 lines (153 loc) · 5.35 KB
/
firebase_options.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
// ignore_for_file: require_trailing_commas
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// ignore_for_file: deprecated_member_use_from_same_package
part of firebase_core_platform_interface;
/// The options used to configure a Firebase app.
///
/// ```dart
/// await Firebase.initializeApp(
/// name: 'SecondaryApp',
/// options: const FirebaseOptions(
/// apiKey: '...',
/// appId: '...',
/// messagingSenderId: '...',
/// projectId: '...',
/// )
/// );
/// ```
@immutable
class FirebaseOptions {
/// The options used to configure a Firebase app.
///
/// ```dart
/// await Firebase.initializeApp(
/// name: 'SecondaryApp',
/// options: const FirebaseOptions(
/// apiKey: '...',
/// appId: '...',
/// messagingSenderId: '...',
/// projectId: '...',
/// )
/// );
/// ```
const FirebaseOptions({
required this.apiKey,
required this.appId,
required this.messagingSenderId,
required this.projectId,
this.authDomain,
this.databaseURL,
this.storageBucket,
this.measurementId,
// ios specific
this.trackingId,
this.deepLinkURLScheme,
this.androidClientId,
this.iosClientId,
this.iosBundleId,
this.appGroupId,
});
/// Named constructor to create [FirebaseOptions] from a the response of Pigeon channel.
///
/// This constructor is used when platforms cannot directly return a
/// [FirebaseOptions] instance, for example when data is sent back from a
/// [MethodChannel].
FirebaseOptions.fromPigeon(PigeonFirebaseOptions options)
: apiKey = options.apiKey,
appId = options.appId,
messagingSenderId = options.messagingSenderId,
projectId = options.projectId,
authDomain = options.authDomain,
databaseURL = options.databaseURL,
storageBucket = options.storageBucket,
measurementId = options.measurementId,
trackingId = options.trackingId,
deepLinkURLScheme = options.deepLinkURLScheme,
androidClientId = options.androidClientId,
iosClientId = options.iosClientId,
iosBundleId = options.iosBundleId,
appGroupId = options.appGroupId;
/// An API key used for authenticating requests from your app to Google
/// servers.
final String apiKey;
/// The Google App ID that is used to uniquely identify an instance of an app.
final String appId;
/// The unique sender ID value used in messaging to identify your app.
final String messagingSenderId;
/// The Project ID from the Firebase console, for example "my-awesome-app".
final String projectId;
/// The auth domain used to handle redirects from OAuth provides on web
/// platforms, for example "my-awesome-app.firebaseapp.com".
final String? authDomain;
/// The database root URL, for example "https://my-awesome-app.firebaseio.com."
///
/// This property should be set for apps that use Firebase Database.
final String? databaseURL;
/// The Google Cloud Storage bucket name, for example
/// "my-awesome-app.appspot.com".
final String? storageBucket;
/// The project measurement ID value used on web platforms with analytics.
final String? measurementId;
/// The tracking ID for Google Analytics, for example "UA-12345678-1", used to
/// configure Google Analytics.
///
/// This property is used on iOS only.
final String? trackingId;
/// The URL scheme used by iOS secondary apps for Dynamic Links.
final String? deepLinkURLScheme;
/// The Android client ID from the Firebase Console, for example
/// "12345.apps.googleusercontent.com."
///
/// This value is used by iOS only.
final String? androidClientId;
/// The iOS client ID from the Firebase Console, for example
/// "12345.apps.googleusercontent.com."
///
/// This value is used by iOS only.
final String? iosClientId;
/// The iOS bundle ID for the application. Defaults to `[[NSBundle mainBundle] bundleID]`
/// when not set manually or in a plist.
///
/// This property is used on iOS only.
final String? iosBundleId;
/// The iOS App Group identifier to share data between the application and the
/// application extensions.
///
/// Note that if using this then the App Group must be configured in the
/// application and on the Apple Developer Portal.
///
/// This property is used on iOS only.
final String? appGroupId;
/// The current instance as a [Map].
Map<String, String?> get asMap {
return <String, String?>{
'apiKey': apiKey,
'appId': appId,
'messagingSenderId': messagingSenderId,
'projectId': projectId,
'authDomain': authDomain,
'databaseURL': databaseURL,
'storageBucket': storageBucket,
'measurementId': measurementId,
'trackingId': trackingId,
'deepLinkURLScheme': deepLinkURLScheme,
'androidClientId': androidClientId,
'iosClientId': iosClientId,
'iosBundleId': iosBundleId,
'appGroupId': appGroupId,
};
}
// Required from `fromMap` comparison
@override
bool operator ==(Object other) {
if (identical(this, other)) return true;
if (other is! FirebaseOptions) return false;
return const MapEquality().equals(asMap, other.asMap);
}
@override
int get hashCode => const MapEquality().hash(asMap);
@override
String toString() => asMap.toString();
}