diff options
-rw-r--r-- | Example/Shared/FIRSampleAppUtilities.m | 1 | ||||
-rw-r--r-- | Firebase/Core/FIRApp.m | 6 | ||||
-rw-r--r-- | Firebase/Core/FIROptions.m | 25 | ||||
-rw-r--r-- | Firebase/Core/Private/FIRAppInternal.h | 7 | ||||
-rw-r--r-- | Firebase/Storage/FIRStorageObservableTask.m | 1 | ||||
-rw-r--r-- | Firestore/Example/Tests/Integration/FSTTransactionTests.mm | 2 | ||||
-rw-r--r-- | Firestore/Source/Core/FSTFirestoreClient.mm | 1 |
7 files changed, 33 insertions, 10 deletions
diff --git a/Example/Shared/FIRSampleAppUtilities.m b/Example/Shared/FIRSampleAppUtilities.m index 7a7ce3b..d161cb9 100644 --- a/Example/Shared/FIRSampleAppUtilities.m +++ b/Example/Shared/FIRSampleAppUtilities.m @@ -88,7 +88,6 @@ NSString *const kInvalidPlistAlertMessage = handler:^(UIAlertAction *_Nonnull action) { NSURL *githubURL = [NSURL URLWithString:kGithubRepoURLString]; [FIRSampleAppUtilities navigateToURL:githubURL fromViewController:viewController]; - }]; [alertController addAction:viewReadmeAction]; diff --git a/Firebase/Core/FIRApp.m b/Firebase/Core/FIRApp.m index eed63b8..c2ce28e 100644 --- a/Firebase/Core/FIRApp.m +++ b/Firebase/Core/FIRApp.m @@ -229,6 +229,8 @@ static NSMutableDictionary *sLibraryVersions; sDefaultApp = nil; [sAllApps removeAllObjects]; sAllApps = nil; + [sLibraryVersions removeAllObjects]; + sLibraryVersions = nil; } - (void)deleteApp:(FIRAppVoidBoolCallback)completion { @@ -426,8 +428,8 @@ static NSMutableDictionary *sLibraryVersions; NSMutableArray<NSString *> *libraries = [[NSMutableArray<NSString *> alloc] initWithCapacity:sLibraryVersions.count]; for (NSString *libraryName in sLibraryVersions) { - [libraries addObject: - [NSString stringWithFormat:@"%@/%@", libraryName, sLibraryVersions[libraryName]]]; + [libraries + addObject:[NSString stringWithFormat:@"%@/%@", libraryName, sLibraryVersions[libraryName]]]; } [libraries sortUsingSelector:@selector(localizedCaseInsensitiveCompare:)]; return [libraries componentsJoinedByString:@" "]; diff --git a/Firebase/Core/FIROptions.m b/Firebase/Core/FIROptions.m index 75f2ed2..e8f6600 100644 --- a/Firebase/Core/FIROptions.m +++ b/Firebase/Core/FIROptions.m @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +#import "Private/FIRAppInternal.h" #import "Private/FIRBundleUtil.h" #import "Private/FIRErrors.h" #import "Private/FIRLogger.h" @@ -108,6 +109,30 @@ static NSDictionary *sDefaultOptionsDictionary = nil; #pragma mark - Private class methods ++ (void)load { + // Report FirebaseCore version for useragent string + NSRange major = NSMakeRange(0, 1); + NSRange minor = NSMakeRange(1, 2); + NSRange patch = NSMakeRange(3, 2); + [FIRApp + registerLibrary:@"fire-ios" + withVersion:[NSString stringWithFormat:@"%@.%d.%d", + [kFIRLibraryVersionID substringWithRange:major], + [[kFIRLibraryVersionID substringWithRange:minor] + intValue], + [[kFIRLibraryVersionID substringWithRange:patch] + intValue]]]; + NSDictionary<NSString *, id> *info = [[NSBundle mainBundle] infoDictionary]; + NSString *xcodeVersion = info[@"DTXcodeBuild"]; + NSString *sdkVersion = info[@"DTSDKBuild"]; + if (xcodeVersion) { + [FIRApp registerLibrary:@"xcode" withVersion:xcodeVersion]; + } + if (sdkVersion) { + [FIRApp registerLibrary:@"apple-sdk" withVersion:sdkVersion]; + } +} + + (NSDictionary *)defaultOptionsDictionary { if (sDefaultOptionsDictionary != nil) { return sDefaultOptionsDictionary; diff --git a/Firebase/Core/Private/FIRAppInternal.h b/Firebase/Core/Private/FIRAppInternal.h index 4b56728..b7cf5e8 100644 --- a/Firebase/Core/Private/FIRAppInternal.h +++ b/Firebase/Core/Private/FIRAppInternal.h @@ -134,7 +134,6 @@ typedef NSString *_Nullable (^FIRAppGetUIDImplementation)(void); */ + (BOOL)isDefaultAppConfigured; - /** * Registers a given third-party library with the given version number to be reported for * analyitcs. @@ -142,8 +141,10 @@ typedef NSString *_Nullable (^FIRAppGetUIDImplementation)(void); * @param library Name of the library * @param version Version of the library */ -+ (void)registerLibrary:(nonnull NSString *)library withVersion:(nonnull NSString *)version - NS_SWIFT_NAME(registerLibrary(_:version:)); +// clang-format off ++ (void)registerLibrary:(NSString *)library + withVersion:(NSString *)version NS_SWIFT_NAME(registerLibrary(_:version:)); +// clang-format on /** * A concatenated string representing all the third-party libraries and version numbers. diff --git a/Firebase/Storage/FIRStorageObservableTask.m b/Firebase/Storage/FIRStorageObservableTask.m index 7d7c61f..af82fa2 100644 --- a/Firebase/Storage/FIRStorageObservableTask.m +++ b/Firebase/Storage/FIRStorageObservableTask.m @@ -206,7 +206,6 @@ [handlersCopy enumerateKeysAndObjectsUsingBlock:^( NSString *_Nonnull key, FIRStorageVoidSnapshot _Nonnull handler, BOOL *_Nonnull stop) { - dispatch_async(callbackQueue, ^{ handler(snapshot); }); diff --git a/Firestore/Example/Tests/Integration/FSTTransactionTests.mm b/Firestore/Example/Tests/Integration/FSTTransactionTests.mm index 21803ea..2464b0c 100644 --- a/Firestore/Example/Tests/Integration/FSTTransactionTests.mm +++ b/Firestore/Example/Tests/Integration/FSTTransactionTests.mm @@ -274,7 +274,6 @@ double newCount = ((NSNumber *)snapshot[@"count"]).doubleValue + 1.0; [transaction setData:@{ @"count" : @(newCount) } forDocument:doc]; return @YES; - } completion:^(id _Nullable result, NSError *_Nullable error) { [expectation fulfill]; @@ -316,7 +315,6 @@ double newCount = ((NSNumber *)snapshot[@"count"]).doubleValue + 1.0; [transaction updateData:@{ @"count" : @(newCount) } forDocument:doc]; return @YES; - } completion:^(id _Nullable result, NSError *_Nullable error) { [expectation fulfill]; diff --git a/Firestore/Source/Core/FSTFirestoreClient.mm b/Firestore/Source/Core/FSTFirestoreClient.mm index 2ef7279..c60bb7c 100644 --- a/Firestore/Source/Core/FSTFirestoreClient.mm +++ b/Firestore/Source/Core/FSTFirestoreClient.mm @@ -300,7 +300,6 @@ NS_ASSUME_NONNULL_BEGIN }]; } }]; - }]; } |