Archived
Configured colours and added additional images to ready app for iOS 13 dark mode
This commit is contained in:
Generated
+1
-1
@@ -352,7 +352,7 @@ static NSMutableDictionary *sLibraryVersions;
|
||||
}
|
||||
|
||||
// Check if the Analytics flag is explicitly set. If so, no further actions are necessary.
|
||||
if ([self.options isAnalyticsCollectionExpicitlySet]) {
|
||||
if ([self.options isAnalyticsCollectionExplicitlySet]) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+31
-6
@@ -23,7 +23,9 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface FIRComponentContainer ()
|
||||
@interface FIRComponentContainer () {
|
||||
dispatch_queue_t _containerQueue;
|
||||
}
|
||||
|
||||
/// The dictionary of components that are registered for a particular app. The key is an NSString
|
||||
/// of the protocol.
|
||||
@@ -67,6 +69,8 @@ static NSMutableSet<Class> *sFIRComponentRegistrants;
|
||||
_app = app;
|
||||
_cachedInstances = [NSMutableDictionary<NSString *, id> dictionary];
|
||||
_components = [NSMutableDictionary<NSString *, FIRComponentCreationBlock> dictionary];
|
||||
_containerQueue =
|
||||
dispatch_queue_create("com.google.FirebaseComponentContainer", DISPATCH_QUEUE_SERIAL);
|
||||
|
||||
[self populateComponentsFromRegisteredClasses:allRegistrants forApp:app];
|
||||
}
|
||||
@@ -92,7 +96,7 @@ static NSMutableSet<Class> *sFIRComponentRegistrants;
|
||||
// Store the creation block for later usage.
|
||||
self.components[protocolName] = component.creationBlock;
|
||||
|
||||
// Instantiate the
|
||||
// Instantiate the instance if it has requested to be instantiated.
|
||||
BOOL shouldInstantiateEager =
|
||||
(component.instantiationTiming == FIRInstantiationTimingAlwaysEager);
|
||||
BOOL shouldInstantiateDefaultEager =
|
||||
@@ -136,7 +140,9 @@ static NSMutableSet<Class> *sFIRComponentRegistrants;
|
||||
|
||||
// The instance is ready to be returned, but check if it should be cached first before returning.
|
||||
if (shouldCache) {
|
||||
self.cachedInstances[protocolName] = instance;
|
||||
dispatch_sync(_containerQueue, ^{
|
||||
self.cachedInstances[protocolName] = instance;
|
||||
});
|
||||
}
|
||||
|
||||
return instance;
|
||||
@@ -147,7 +153,11 @@ static NSMutableSet<Class> *sFIRComponentRegistrants;
|
||||
- (nullable id)instanceForProtocol:(Protocol *)protocol {
|
||||
// Check if there is a cached instance, and return it if so.
|
||||
NSString *protocolName = NSStringFromProtocol(protocol);
|
||||
id cachedInstance = self.cachedInstances[protocolName];
|
||||
__block id cachedInstance;
|
||||
dispatch_sync(_containerQueue, ^{
|
||||
cachedInstance = self.cachedInstances[protocolName];
|
||||
});
|
||||
|
||||
if (cachedInstance) {
|
||||
return cachedInstance;
|
||||
}
|
||||
@@ -161,14 +171,29 @@ static NSMutableSet<Class> *sFIRComponentRegistrants;
|
||||
|
||||
- (void)removeAllCachedInstances {
|
||||
// Loop through the cache and notify each instance that is a maintainer to clean up after itself.
|
||||
for (id instance in self.cachedInstances.allValues) {
|
||||
// Design note: we're getting a copy here, unlocking the cached instances, iterating over the
|
||||
// copy, then locking and removing all cached instances. A race condition *could* exist where a
|
||||
// new cached instance is created between the copy and the removal, but the chances are slim and
|
||||
// side-effects are significantly smaller than including the entire loop in the `dispatch_sync`
|
||||
// block (access to the cache from inside the block would deadlock and crash).
|
||||
__block NSDictionary<NSString *, id> *instancesCopy;
|
||||
dispatch_sync(_containerQueue, ^{
|
||||
instancesCopy = [self.cachedInstances copy];
|
||||
});
|
||||
|
||||
for (id instance in instancesCopy.allValues) {
|
||||
if ([instance conformsToProtocol:@protocol(FIRComponentLifecycleMaintainer)] &&
|
||||
[instance respondsToSelector:@selector(appWillBeDeleted:)]) {
|
||||
[instance appWillBeDeleted:self.app];
|
||||
}
|
||||
}
|
||||
|
||||
[self.cachedInstances removeAllObjects];
|
||||
instancesCopy = nil;
|
||||
|
||||
// Empty the cache.
|
||||
dispatch_sync(_containerQueue, ^{
|
||||
[self.cachedInstances removeAllObjects];
|
||||
});
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
+1
-1
@@ -399,7 +399,7 @@ static NSDictionary *sDefaultOptionsDictionary = nil;
|
||||
return [value boolValue];
|
||||
}
|
||||
|
||||
- (BOOL)isAnalyticsCollectionExpicitlySet {
|
||||
- (BOOL)isAnalyticsCollectionExplicitlySet {
|
||||
// If it's de-activated, it classifies as explicity set. If not, it's not a good enough indication
|
||||
// that the developer wants FirebaseAnalytics enabled so continue checking.
|
||||
if (self.isAnalyticsCollectionDeactivated) {
|
||||
|
||||
@@ -65,7 +65,7 @@ extern NSString *const kServiceInfoFileType;
|
||||
* Indicates whether or not Analytics collection was explicitly enabled via a plist flag or at
|
||||
* runtime.
|
||||
*/
|
||||
@property(nonatomic, readonly) BOOL isAnalyticsCollectionExpicitlySet;
|
||||
@property(nonatomic, readonly) BOOL isAnalyticsCollectionExplicitlySet;
|
||||
|
||||
/**
|
||||
* Whether or not Analytics Collection was enabled. Analytics Collection is enabled unless
|
||||
|
||||
Generated
+17
-10
@@ -1,9 +1,10 @@
|
||||
# Firebase iOS Open Source Development [](https://travis-ci.org/firebase/firebase-ios-sdk)
|
||||
|
||||
This repository contains a subset of the Firebase iOS SDK source. It currently
|
||||
includes FirebaseCore, FirebaseAuth, FirebaseDatabase, FirebaseFirestore,
|
||||
FirebaseFunctions, FirebaseInstanceID, FirebaseInAppMessaging,
|
||||
FirebaseInAppMessagingDisplay, FirebaseMessaging and FirebaseStorage.
|
||||
includes FirebaseCore, FirebaseABTesting, FirebaseAuth, FirebaseDatabase,
|
||||
FirebaseFirestore, FirebaseFunctions, FirebaseInstanceID, FirebaseInAppMessaging,
|
||||
FirebaseInAppMessagingDisplay, FirebaseMessaging, FirebaseRemoteConfig, and
|
||||
FirebaseStorage.
|
||||
|
||||
The repository also includes GoogleUtilities source. The
|
||||
[GoogleUtilities](GoogleUtilities/README.md) pod is
|
||||
@@ -80,9 +81,8 @@ For the pod that you want to develop:
|
||||
|
||||
`pod gen Firebase{name here}.podspec --local-sources=./ --auto-open`
|
||||
|
||||
Firestore and Functions have self contained Xcode projects. See
|
||||
[Firestore/README.md](Firestore/README.md) and
|
||||
[Functions/README.md](Functions/README.md).
|
||||
Firestore has a self contained Xcode project. See
|
||||
[Firestore/README.md](Firestore/README.md).
|
||||
|
||||
### Adding a New Firebase Pod
|
||||
|
||||
@@ -99,13 +99,17 @@ Travis will verify that any code changes are done in a style compliant way. Inst
|
||||
These commands will get the right versions:
|
||||
|
||||
```
|
||||
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/773cb75d360b58f32048f5964038d09825a507c8/Formula/clang-format.rb
|
||||
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/3dfea1004e0736754bbf49673cca8aaed8a94089/Formula/swiftformat.rb
|
||||
brew upgrade https://raw.githubusercontent.com/Homebrew/homebrew-core/e3496d9/Formula/clang-format.rb
|
||||
brew upgrade https://raw.githubusercontent.com/Homebrew/homebrew-core/7963c3d/Formula/swiftformat.rb
|
||||
```
|
||||
|
||||
Note: if you already have a newer version of these installed you may need to
|
||||
`brew switch` to this version.
|
||||
|
||||
To update this section, find the versions of clang-format and swiftformat.rb to
|
||||
match the versions in the CI failure logs
|
||||
[here](https://github.com/Homebrew/homebrew-core/tree/master/Formula).
|
||||
|
||||
### Running Unit Tests
|
||||
|
||||
Select a scheme and press Command-u to build a component and run its unit tests.
|
||||
@@ -179,8 +183,9 @@ very grateful! We'd like to empower as many developers as we can to be able to
|
||||
participate in the Firebase community.
|
||||
|
||||
### macOS and tvOS
|
||||
Thanks to contributions from the community, FirebaseAuth, FirebaseCore, FirebaseDatabase, FirebaseMessaging,
|
||||
FirebaseFirestore, FirebaseFunctions and FirebaseStorage now compile, run unit tests, and work on
|
||||
Thanks to contributions from the community, FirebaseABTesting, FirebaseAuth, FirebaseCore,
|
||||
FirebaseDatabase, FirebaseMessaging, FirebaseFirestore,
|
||||
FirebaseFunctions, FirebaseRemoteConfig, and FirebaseStorage now compile, run unit tests, and work on
|
||||
macOS and tvOS.
|
||||
|
||||
For tvOS, checkout the [Sample](Example/tvOSSample).
|
||||
@@ -195,12 +200,14 @@ Note that the Firebase pod is not available for macOS and tvOS.
|
||||
To install, add a subset of the following to the Podfile:
|
||||
|
||||
```
|
||||
pod 'FirebaseABTesting'
|
||||
pod 'FirebaseAuth'
|
||||
pod 'FirebaseCore'
|
||||
pod 'FirebaseDatabase'
|
||||
pod 'FirebaseFirestore'
|
||||
pod 'FirebaseFunctions'
|
||||
pod 'FirebaseMessaging'
|
||||
pod 'FirebaseRemoteConfig'
|
||||
pod 'FirebaseStorage'
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user