Skip to content

Commit

Permalink
Deprecate androidClientID and trackingID (firebase#10520)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulb777 authored Dec 15, 2022
1 parent 8a0bb35 commit 1fa2b4f
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 42 deletions.
3 changes: 3 additions & 0 deletions FirebaseCore/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Firebase 10.4.0
- Deprecate `androidClientID` and `trackingID` from FirebaseOptions. (#10520)

# Firebase 10.2.0
- Update GTMSessionFetcher dependency specifications to enable support for the compatible
GTMSessionFetcher 3.x versions.
Expand Down
4 changes: 2 additions & 2 deletions FirebaseCore/Sources/Public/FirebaseCore/FIROptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ NS_SWIFT_NAME(FirebaseOptions)
/**
* Unused.
*/
@property(nonatomic, copy, nullable) NSString *trackingID;
@property(nonatomic, copy, nullable) NSString *trackingID DEPRECATED_ATTRIBUTE;

/**
* The Project Number from the Google Developer's console, for example @"012345678901", used to
Expand All @@ -68,7 +68,7 @@ NS_SWIFT_NAME(FirebaseOptions)
/**
* Unused.
*/
@property(nonatomic, copy, nullable) NSString *androidClientID;
@property(nonatomic, copy, nullable) NSString *androidClientID DEPRECATED_ATTRIBUTE;

/**
* The Google App ID that is used to uniquely identify an instance of an app.
Expand Down
8 changes: 0 additions & 8 deletions FirebaseCore/Tests/SwiftUnit/CoreAPITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -123,18 +123,10 @@ final class CoreAPITests {
// ...
}

if let _ /* trackingID */ = options.trackingID {
// ...
}

if let _ /* projectID */ = options.projectID {
// ...
}

if let _ /* androidClientID */ = options.androidClientID {
// ...
}

if let _ /* databaseURL */ = options.databaseURL {
// ...
}
Expand Down
1 change: 0 additions & 1 deletion FirebaseCore/Tests/SwiftUnit/FirebaseAppTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,6 @@ class FirebaseAppTests: XCTestCase {
XCTAssertEqual(app.options.googleAppID, Constants.Options.googleAppID)
XCTAssertEqual(app.options.gcmSenderID, Constants.Options.gcmSenderID)
XCTAssertEqual(app.options.deepLinkURLScheme, superSecretURLScheme)
XCTAssertNil(app.options.androidClientID)
}

func testFirebaseDataCollectionDefaultEnabled() throws {
Expand Down
9 changes: 0 additions & 9 deletions FirebaseCore/Tests/SwiftUnit/FirebaseOptionsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ class FirebaseOptionsTests: XCTestCase {
options.bundleID = Constants.Options.bundleID
options.apiKey = Constants.Options.apiKey
options.clientID = Constants.Options.clientID
options.trackingID = Constants.Options.trackingID
options.projectID = Constants.Options.projectID
options.databaseURL = Constants.Options.databaseURL
options.storageBucket = Constants.Options.storageBucket
Expand All @@ -96,10 +95,6 @@ class FirebaseOptionsTests: XCTestCase {
options.deepLinkURLScheme = Constants.Options.deepLinkURLScheme
XCTAssertEqual(options.deepLinkURLScheme, Constants.Options.deepLinkURLScheme)

XCTAssertNil(options.androidClientID)
options.androidClientID = Constants.Options.androidClientID
XCTAssertEqual(options.androidClientID, Constants.Options.androidClientID)

XCTAssertNil(options.appGroupID)
options.appGroupID = Constants.Options.appGroupID
XCTAssertEqual(options.appGroupID, Constants.Options.appGroupID)
Expand Down Expand Up @@ -147,10 +142,8 @@ class FirebaseOptionsTests: XCTestCase {
XCTAssertEqual(options.apiKey, Constants.Options.apiKey)
XCTAssertEqual(options.bundleID, Constants.Options.bundleID)
XCTAssertEqual(options.clientID, Constants.Options.clientID)
XCTAssertEqual(options.trackingID, Constants.Options.trackingID)
XCTAssertEqual(options.gcmSenderID, Constants.Options.gcmSenderID)
XCTAssertEqual(options.projectID, Constants.Options.projectID)
XCTAssertNil(options.androidClientID)
XCTAssertEqual(options.googleAppID, Constants.Options.googleAppID)
XCTAssertEqual(options.databaseURL, Constants.Options.databaseURL)
XCTAssertNil(options.deepLinkURLScheme)
Expand All @@ -161,9 +154,7 @@ class FirebaseOptionsTests: XCTestCase {
private func assertNullableOptionsAreEmpty(options: FirebaseOptions) {
XCTAssertNil(options.apiKey)
XCTAssertNil(options.clientID)
XCTAssertNil(options.trackingID)
XCTAssertNil(options.projectID)
XCTAssertNil(options.androidClientID)
XCTAssertNil(options.databaseURL)
XCTAssertNil(options.deepLinkURLScheme)
XCTAssertNil(options.storageBucket)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@ public enum Constants {
static let apiKey = "correct_api_key"
static let bundleID = "com.google.FirebaseSDKTests"
static let clientID = "correct_client_id"
static let trackingID = "correct_tracking_id"
static let gcmSenderID = "correct_gcm_sender_id"
static let projectID = "abc-xyz-123"
static let androidClientID = "correct_android_client_id"
static let googleAppID = "1:123:ios:123abc"
static let databaseURL = "https://abc-xyz-123.firebaseio.com"
static let deepLinkURLScheme = "comgoogledeeplinkurl"
Expand Down
15 changes: 0 additions & 15 deletions FirebaseCore/Tests/Unit/FIROptionsTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ - (void)testInitCustomizedOptions {
options.deepLinkURLScheme = kDeepLinkURLScheme;
options.projectID = kProjectID;
options.storageBucket = kStorageBucket;
options.trackingID = kTrackingID;
[self assertOptionsMatchDefaults:options andProjectID:YES];
XCTAssertEqualObjects(options.deepLinkURLScheme, kDeepLinkURLScheme);
XCTAssertFalse(options.usingOptionsFromDefaultPlist);
Expand All @@ -158,9 +157,7 @@ - (void)assertOptionsMatchDefaults:(FIROptions *)options andProjectID:(BOOL)matc
XCTAssertEqualObjects(options.googleAppID, kGoogleAppID);
XCTAssertEqualObjects(options.APIKey, kAPIKey);
XCTAssertEqualObjects(options.clientID, kClientID);
XCTAssertEqualObjects(options.trackingID, kTrackingID);
XCTAssertEqualObjects(options.GCMSenderID, kGCMSenderID);
XCTAssertNil(options.androidClientID);
XCTAssertEqualObjects(options.libraryVersionID, kFIRLibraryVersionID);
XCTAssertEqualObjects(options.databaseURL, kDatabaseURL);
XCTAssertEqualObjects(options.storageBucket, kStorageBucket);
Expand Down Expand Up @@ -192,11 +189,6 @@ - (void)testCopyingProperties {
[mutableString appendString:@"2"];
XCTAssertEqualObjects(options.clientID, @"1");

mutableString = [[NSMutableString alloc] initWithString:@"1"];
options.trackingID = mutableString;
[mutableString appendString:@"2"];
XCTAssertEqualObjects(options.trackingID, @"1");

mutableString = [[NSMutableString alloc] initWithString:@"1"];
options.GCMSenderID = mutableString;
[mutableString appendString:@"2"];
Expand All @@ -207,11 +199,6 @@ - (void)testCopyingProperties {
[mutableString appendString:@"2"];
XCTAssertEqualObjects(options.projectID, @"1");

mutableString = [[NSMutableString alloc] initWithString:@"1"];
options.androidClientID = mutableString;
[mutableString appendString:@"2"];
XCTAssertEqualObjects(options.androidClientID, @"1");

mutableString = [[NSMutableString alloc] initWithString:@"1"];
options.googleAppID = mutableString;
[mutableString appendString:@"2"];
Expand Down Expand Up @@ -597,7 +584,6 @@ - (void)testModifyingOptionsThrows {
options.editingLocked = YES;

// Modification to every property should result in an exception.
XCTAssertThrows(options.androidClientID = @"should_throw");
XCTAssertThrows(options.APIKey = @"should_throw");
XCTAssertThrows(options.bundleID = @"should_throw");
XCTAssertThrows(options.clientID = @"should_throw");
Expand All @@ -607,7 +593,6 @@ - (void)testModifyingOptionsThrows {
XCTAssertThrows(options.googleAppID = @"should_throw");
XCTAssertThrows(options.projectID = @"should_throw");
XCTAssertThrows(options.storageBucket = @"should_throw");
XCTAssertThrows(options.trackingID = @"should_throw");
}

- (void)testVersionFormat {
Expand Down
2 changes: 0 additions & 2 deletions SharedTestUtilities/FIROptionsMock.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ NS_ASSUME_NONNULL_BEGIN
extern NSString *const kAPIKey;
extern NSString *const kCustomizedAPIKey;
extern NSString *const kClientID;
extern NSString *const kTrackingID;
extern NSString *const kGCMSenderID;
extern NSString *const kAndroidClientID;
extern NSString *const kGoogleAppID;
extern NSString *const kDatabaseURL;
extern NSString *const kStorageBucket;
Expand Down
3 changes: 0 additions & 3 deletions SharedTestUtilities/FIROptionsMock.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@
#import "FirebaseCore/Extension/FIROptionsInternal.h"
#import "SharedTestUtilities/FIROptionsMock.h"

NSString *const kAndroidClientID = @"correct_android_client_id";
NSString *const kAPIKey = @"correct_api_key";
NSString *const kCustomizedAPIKey = @"customized_api_key";
NSString *const kClientID = @"correct_client_id";
NSString *const kTrackingID = @"correct_tracking_id";
NSString *const kGCMSenderID = @"correct_gcm_sender_id";
NSString *const kGoogleAppID = @"1:123:ios:123abc";
NSString *const kDatabaseURL = @"https://abc-xyz-123.firebaseio.com";
Expand Down Expand Up @@ -50,7 +48,6 @@ + (void)mockFIROptions {
kFIRGoogleAppID : kGoogleAppID,
kFIRProjectID : kProjectID,
kFIRStorageBucket : kStorageBucket,
kFIRTrackingID : kTrackingID,
};
id optionsClassMock = OCMClassMock([FIROptions class]);
OCMStub([optionsClassMock defaultOptionsDictionary]).andReturn(mockDictionary);
Expand Down

0 comments on commit 1fa2b4f

Please sign in to comment.