Skip to content

Commit 370a305

Browse files
author
Greg Soltis
committed
Expose library version, move it out of options
1 parent 52cdf0b commit 370a305

File tree

4 files changed

+21
-11
lines changed

4 files changed

+21
-11
lines changed

Example/Core/Tests/FIROptionsTest.m

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
extern NSString *const kFIRIsMeasurementEnabled;
2222
extern NSString *const kFIRIsAnalyticsCollectionEnabled;
2323
extern NSString *const kFIRIsAnalyticsCollectionDeactivated;
24-
extern NSString *const kFIRLibraryVersionID;
2524

2625
@interface FIROptions (Test)
2726

@@ -153,7 +152,6 @@ - (void)assertOptionsMatchDefaults:(FIROptions *)options andProjectID:(BOOL)matc
153152
XCTAssertEqualObjects(options.trackingID, kTrackingID);
154153
XCTAssertEqualObjects(options.GCMSenderID, kGCMSenderID);
155154
XCTAssertEqualObjects(options.androidClientID, kAndroidClientID);
156-
XCTAssertEqualObjects(options.libraryVersionID, kFIRLibraryVersionID);
157155
XCTAssertEqualObjects(options.databaseURL, kDatabaseURL);
158156
XCTAssertEqualObjects(options.storageBucket, kStorageBucket);
159157
XCTAssertEqualObjects(options.bundleID, kBundleID);

Firebase/Core/FIRLogger.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#import "Private/FIRLogger.h"
1616

1717
#import "FIRLoggerLevel.h"
18+
#import "FIRVersion.h"
1819
#import "third_party/FIRAppEnvironmentUtil.h"
1920

2021
#include <asl.h>
@@ -229,7 +230,7 @@ void FIRLogBasic(FIRLoggerLevel level,
229230
NSCAssert(numberOfMatches == 1, @"Incorrect message code format.");
230231
#endif
231232
NSString *logMsg = [[NSString alloc] initWithFormat:message arguments:args_ptr];
232-
logMsg = [NSString stringWithFormat:@"%@[%@] %@", service, messageCode, logMsg];
233+
logMsg = [NSString stringWithFormat:@"%@ - %@[%@] %@", kFIRLibraryVersionID, service, messageCode, logMsg];
233234
dispatch_async(sFIRClientQueue, ^{
234235
asl_log(sFIRLoggerClient, NULL, level, "%s", logMsg.UTF8String);
235236
});

Firebase/Core/FIROptions.m

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -303,14 +303,6 @@ - (void)setGoogleAppID:(NSString *)googleAppID {
303303
_optionsDictionary[kFIRGoogleAppID] = [googleAppID copy];
304304
}
305305

306-
- (NSString *)libraryVersionID {
307-
return kFIRLibraryVersionID;
308-
}
309-
310-
- (void)setLibraryVersionID:(NSString *)libraryVersionID {
311-
_optionsDictionary[kFIRLibraryVersionID] = [libraryVersionID copy];
312-
}
313-
314306
- (NSString *)databaseURL {
315307
return self.optionsDictionary[kFIRDatabaseURL];
316308
}

Firebase/Core/Public/FIRVersion.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* Copyright 2017 Google
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#import <Foundation/Foundation.h>
18+
19+
extern NSString *const kFIRLibraryVersionID;

0 commit comments

Comments
 (0)