Skip to content

Commit 5d8431c

Browse files
committed
Merge branch 'master' into md-fdl
2 parents e85b0c7 + c2fd8d1 commit 5d8431c

File tree

247 files changed

+71067
-42440
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

247 files changed

+71067
-42440
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,12 @@ set(BUILD_TESTING ${old_build_testing} CACHE BOOL "Restore BUILD_TESTING" FORCE)
8989

9090

9191
# gRPC
92-
find_package(OpenSSL)
92+
find_package(OpenSSL QUIET)
9393
if(OPENSSL_FOUND)
9494
set(gRPC_SSL_PROVIDER package CACHE STRING "Use external OpenSSL")
9595
endif()
9696

97-
find_package(ZLIB)
97+
find_package(ZLIB QUIET)
9898
if(ZLIB_FOUND)
9999
set(gRPC_ZLIB_PROVIDER package CACHE STRING "Use external ZLIB")
100100
endif()

Carthage.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33
## Context
44

55
This page introduces and provides instructions for an **experimental** Firebase
6-
[Carthage](https://github.com/Carthage/Carthage) implementation. Based on
7-
feedback and usage, the Firebase team may decide to make the Carthage
8-
distribution official.
6+
[Carthage](https://github.com/Carthage/Carthage) distribution. Based on
7+
feedback and usage, the Firebase team may decide to [make the Carthage
8+
distribution official](https://github.com/firebase/firebase-ios-sdk/issues/1862).
99

1010
Please [let us know](https://github.com/firebase/firebase-ios-sdk/issues) if you
11-
have suggestions about how best to distribute Carthage binaries that include
12-
resource bundles.
11+
have suggestions or questions.
1312

1413
## Carthage Installation
1514

@@ -28,7 +27,7 @@ more details and additional installation methods.
2827

2928
- Create a Cartfile with a **subset** of the following components - choosing the
3029
Firebase components that you want to include in your app. Note that
31-
**FirebaseAnalytics** must always be included.
30+
**FirebaseAnalyticsBinary** must always be included.
3231
```
3332
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseABTestingBinary.json"
3433
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAdMobBinary.json"
@@ -39,6 +38,8 @@ binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseDatabaseBinary.js
3938
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseDynamicLinksBinary.json"
4039
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseFirestoreBinary.json"
4140
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseFunctionsBinary.json"
41+
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseInAppMessagingBinary.json"
42+
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseInAppMessagingDisplayBinary.json"
4243
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseInvitesBinary.json"
4344
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseMessagingBinary.json"
4445
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseMLModelInterpreterBinary.json"
@@ -55,8 +56,8 @@ binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseStorageBinary.jso
5556
- Use Finder to open `Carthage/Build/iOS`.
5657
- Copy the contents into the top level of your Xcode project and make sure
5758
they're added to the right build target(s).
58-
- Add the -ObjC flag to "Other Linker Flags".
59-
- Make sure that the build target(s) includes your project's `GoogleService-Info.plist`.
59+
- Add `$(OTHER_LDFLAGS) -ObjC` flag to "Other Linker Flags" in "Build Settings".
60+
- Make sure that the build target(s) includes your project's `GoogleService-Info.plist` ([how to download config file](https://support.google.com/firebase/answer/7015592))
6061
- [Delete Firebase.framework from the Link Binary With Libraries Build Phase](https://github.com/firebase/firebase-ios-sdk/issues/911#issuecomment-372455235).
6162
- If you're including a Firebase component that has resources, copy its bundles
6263
into the Xcode project and make sure they're added to the

Example/Auth/ApiTests/FirebaseAuthApiTests.m

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323

2424
#ifdef NO_NETWORK
2525
#import "ITUIOSTestUtil.h"
26-
#import "ioReplayer/IORManager.h"
27-
#import "ioReplayer/IORTestCase.h"
2826
#endif
2927

3028
#import <GTMSessionFetcher/GTMSessionFetcher.h>
@@ -93,11 +91,8 @@
9391
#define SKIP_IF_ON_MOBILE_HARNESS
9492
#endif
9593

96-
#ifdef NO_NETWORK
97-
@interface ApiTests : IORTestCase
98-
#else
9994
@interface ApiTests : XCTestCase
100-
#endif
95+
10196
@end
10297

10398
@implementation ApiTests

Example/Auth/EarlGreyTests/FirebaseAuthEarlGreyTests.m

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@
2121
#import <FirebaseCore/FIRApp.h>
2222
#import "FirebaseAuth.h"
2323

24-
#ifdef NO_NETWORK
25-
#import "ioReplayer/IORTestCase.h"
26-
#endif
27-
2824
/** The url for obtaining a valid custom token string used to test BYOAuth. */
2925
static NSString *const kCustomTokenUrl = @"https://fb-sa-1211.appspot.com/token";
3026

@@ -38,11 +34,7 @@
3834

3935
static NSTimeInterval const kWaitForElementTimeOut = 5;
4036

41-
#ifdef NO_NETWORK
42-
@interface BasicUITest : IORTestCase
43-
#else
4437
@interface BasicUITest :XCTestCase
45-
#endif
4638
@end
4739

4840
/** Convenience function for EarlGrey tests. */

Example/Auth/Sample/AppManager.m

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@
2222

2323
NS_ASSUME_NONNULL_BEGIN
2424

25-
// Declares a private method of FIRInstanceID to work around a bug.
26-
@interface FIRInstanceID : NSObject
27-
+ (void)notifyTokenRefresh;
28-
@end
29-
3025
@implementation AppManager {
3126
/** @var _createdAppNames
3227
@brief The set of names of live (created but not deleted) app, to avoid iCore warnings.
@@ -59,7 +54,6 @@ - (void)recreateAppAtIndex:(int)index
5954
completion:(void (^)())completion {
6055
[self deleteAppAtIndex:index completion:^() {
6156
if (index == 0) {
62-
[FIRInstanceID notifyTokenRefresh]; // b/28967043
6357
if (options) {
6458
[FIRApp configureWithOptions:options];
6559
}

Example/Auth/Sample/SettingsViewController.m

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,21 @@ - (NSString *)projectIDForAppAtIndex:(int)index {
281281
return @"[none]";
282282
}
283283

284+
/** @fn googleAppIDForAppAtIndex:
285+
@brief Returns the Google App ID for the Firebase app at the given index.
286+
@param index The index for the app in the app manager.
287+
@return The Google App ID of the project.
288+
*/
289+
- (NSString *)googleAppIDForAppAtIndex:(int)index {
290+
NSString *APIKey = [[AppManager sharedInstance] appAtIndex:index].options.APIKey;
291+
for (FIROptions *options in gFirebaseAppOptions) {
292+
if ([options.APIKey isEqualToString:APIKey]) {
293+
return options.googleAppID;
294+
}
295+
}
296+
return @"[none]";
297+
}
298+
284299
/** @fn toggleProjectForAppAtIndex:
285300
@brief Toggles the Firebase project for the Firebase app at the given index by recreating the
286301
FIRApp instance with different options.
@@ -295,10 +310,19 @@ - (void)toggleProjectForAppAtIndex:(int)index {
295310
break;
296311
}
297312
}
298-
// For non-default apps, `nil` is considered the next option after the last options in the array.
299-
int useNil = index > 0;
300-
optionIndex = (optionIndex + 1 + useNil) % (gFirebaseAppOptions.count + useNil) - useNil;
301-
FIROptions *options = optionIndex >= 0 ? gFirebaseAppOptions[optionIndex] : nil;
313+
314+
FIROptions *options;
315+
if (index == 0) {
316+
// For default apps, the next options cannot be `nil`.
317+
optionIndex = (optionIndex + 1) % gFirebaseAppOptions.count;
318+
options = gFirebaseAppOptions[optionIndex];
319+
} else {
320+
// For non-default apps, `nil` is considered the next options after the last options in the array.
321+
optionIndex = (optionIndex + 1) % (gFirebaseAppOptions.count + 1);
322+
if (optionIndex != gFirebaseAppOptions.count) {
323+
options = gFirebaseAppOptions[optionIndex];
324+
}
325+
}
302326
__weak typeof(self) weakSelf = self;
303327
[[AppManager sharedInstance] recreateAppAtIndex:index withOptions:options completion:^() {
304328
dispatch_async(dispatch_get_main_queue(), ^() {

Example/Auth/Tests/FIRAuthDispatcherTests.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
@brief The maximum difference between time intervals (in seconds), after which they will be
2323
considered different.
2424
*/
25-
static const NSTimeInterval kMaxDifferenceBetweenTimeIntervals = 0.1;
25+
static const NSTimeInterval kMaxDifferenceBetweenTimeIntervals = 0.3;
2626

2727
/** @var kTestDelay
2828
@brief Fake time delay before tasks are dispatched.

0 commit comments

Comments
 (0)