Skip to content

refactor(firebase_core)!: remove deprecated APIs #4591

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 0 additions & 33 deletions packages/firebase_core/firebase_core/lib/src/firebase_app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,39 +27,6 @@ class FirebaseApp {
await _delegate.delete();
}

@Deprecated("Deprecated in favor of Firebase.app()")
// ignore: public_member_api_docs
static FirebaseApp appNamed(String name) {
return Firebase.app(name);
}

@Deprecated("Deprecated in favor of Firebase.apps")
// ignore: public_member_api_docs
static Future<List<FirebaseApp>> allApps() async {
return Firebase.apps;
}

@Deprecated("Deprecated in favor of Firebase.initializeApp()")
// ignore: public_member_api_docs
static Future<FirebaseApp> configure({
@required String name,
@required FirebaseOptions options,
}) {
return Firebase.initializeApp(name: name, options: options);
}

@Deprecated("Deprecated in favor of Firebase.app()")
// ignore: public_member_api_docs
static FirebaseApp get instance {
return Firebase.app();
}

@Deprecated("Deprecated in favor of defaultFirebaseAppName")
// ignore: public_member_api_docs
static String get defaultAppName {
return defaultFirebaseAppName;
}

/// The name of this [FirebaseApp].
String get name => _delegate.name;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
// ignore_for_file: deprecated_member_use_from_same_package
part of firebase_core_platform_interface;

// TODO(ehesp): Remove Deprecations with null safety

/// The options used to configure a Firebase app.
///
/// ```dart
Expand Down Expand Up @@ -50,21 +48,11 @@ class FirebaseOptions {
this.iosClientId,
this.iosBundleId,
this.appGroupId,
// deprecated
@Deprecated("Deprecated in favor of 'appId'") this.googleAppID,
@Deprecated("Deprecated in favor of 'projectId'") this.projectID,
@Deprecated("Deprecated in favor of 'iosBundleId'") this.bundleID,
@Deprecated("Deprecated in favor of 'androidClientId' and 'iosClientId'")
this.clientID,
@Deprecated("Deprecated in favor of 'trackingId'") this.trackingID,
@Deprecated("Deprecated in favor of 'messagingSenderId'") this.gcmSenderID,
}) : assert(apiKey != null, "'apiKey' cannot be null"),
assert(appId != null || googleAppID != null,
"'appId' and 'googleAppID' cannot be null."),
assert(messagingSenderId != null || gcmSenderID != null,
"'messagingSenderId' and 'gcmSenderID' cannot be null."),
assert(projectId != null || projectID != null,
"'projectId' and 'projectID' cannot be null.");
assert(appId != null, "'appId' cannot be null."),
assert(
messagingSenderId != null, "'messagingSenderId' cannot be null."),
assert(projectId != null, "'projectId' cannot be null.");

/// Named constructor to create [FirebaseOptions] from a Map.
///
Expand All @@ -73,16 +61,14 @@ class FirebaseOptions {
/// [MethodChannel].
FirebaseOptions.fromMap(Map<dynamic, dynamic> map)
: assert(map['apiKey'] != null, "'apiKey' cannot be null."),
assert(map['appId'] != null || map['googleAppID'],
"'appId' and 'googleAppID' cannot be null."),
assert(map['messagingSenderId'] != null || map['gcmSenderID'],
"'messagingSenderId' and 'gcmSenderID' cannot be null."),
assert(map['projectId'] != null || map['projectID'],
"'projectId' and 'projectID' cannot be null."),
assert(map['appId'] != null, "'appId' cannot be null."),
assert(map['messagingSenderId'] != null,
"'messagingSenderId' cannot be null."),
assert(map['projectId'] != null, "'projectId' cannot be null."),
apiKey = map['apiKey'],
appId = map['appId'] ?? map['googleAppID'],
messagingSenderId = map['messagingSenderId'] ?? map['gcmSenderID'],
projectId = map['projectId'] ?? map['projectID'],
appId = map['appId'],
messagingSenderId = map['messagingSenderId'],
projectId = map['projectId'],
authDomain = map['authDomain'],
databaseURL = map['databaseURL'],
storageBucket = map['storageBucket'],
Expand All @@ -92,14 +78,7 @@ class FirebaseOptions {
androidClientId = map['androidClientId'],
iosClientId = map['iosClientId'],
iosBundleId = map['iosBundleId'],
appGroupId = map['appGroupId'],
trackingID = map['trackingID'] ?? map['trackingId'],
googleAppID = map['googleAppID'] ?? map['appId'],
projectID = map['projectID'] ?? map['projectId'],
bundleID = map['bundleID'] ?? map['iosBundleId'],
clientID =
map['clientID'] ?? map['androidClientId'] ?? map['iosClientId'],
gcmSenderID = map['gcmSenderID'] ?? map['messagingSenderId'];
appGroupId = map['appGroupId'];

/// An API key used for authenticating requests from your app, for example
/// "AIzaSyDdVgKwhZl0sTTTLZ7iTmt1r3N2cJLnaDk", used to identify your app to
Expand Down Expand Up @@ -171,46 +150,22 @@ class FirebaseOptions {
/// This property is used on iOS only.
final String appGroupId;

@Deprecated("Deprecated in favor of 'appId'")
// ignore: public_member_api_docs
final String googleAppID;

@Deprecated("Deprecated in favor of 'projectId'")
// ignore: public_member_api_docs
final String projectID;

@Deprecated("Deprecated in favor of 'iosBundleId'")
// ignore: public_member_api_docs
final String bundleID;

@Deprecated("Deprecated in favor of 'androidClientId' or 'iosClientId")
// ignore: public_member_api_docs
final String clientID;

@Deprecated("Deprecated in favor of 'trackingId'")
// ignore: public_member_api_docs
final String trackingID;

@Deprecated("Deprecated in favor of 'messagingSenderId'")
// ignore: public_member_api_docs
final String gcmSenderID;

/// The current instance as a [Map].
Map<String, String> get asMap {
return <String, String>{
'apiKey': apiKey ?? googleAppID,
'apiKey': apiKey,
'appId': appId,
'messagingSenderId': messagingSenderId ?? gcmSenderID,
'projectId': projectId ?? projectID,
'messagingSenderId': messagingSenderId,
'projectId': projectId,
'authDomain': authDomain,
'databaseURL': databaseURL,
'storageBucket': storageBucket,
'measurementId': measurementId,
'trackingId': trackingId ?? trackingID,
'trackingId': trackingId,
'deepLinkURLScheme': deepLinkURLScheme,
'androidClientId': androidClientId ?? clientID,
'iosClientId': iosClientId ?? clientID,
'iosBundleId': iosBundleId ?? bundleID,
'androidClientId': androidClientId,
'iosClientId': iosClientId,
'iosBundleId': iosBundleId,
'appGroupId': appGroupId,
};
}
Expand Down