Skip to content

Commit e46aefa

Browse files
committed
Merge branch 'master' into bs-auth-cleanup
* master: (128 commits) Add a nanopb string (#1839) Update Auth samples to sync with internal changes (#2056) Add clang-format installation instructions (#2057) Delete Firestore public C++ API (#2050) Porting Multi-Tab Structural Changes (#2049) Remove Mutation tombstones (#2052) Release 5.12.0 (#2051) Fix analyze errors (#2047) Isolate Firestore nanopb messages in C++ namespaces (#2046) Fix auth multi app support (#2043) Add missing nanopb flag (#2042) Delete deprecated files (#2038) Address travis timeout flakes (#2033) Fix tablet layout for in-app messaging (#2032) Held Write Acks Changelog (#2037) Remove Held Write Acks (#2029) Move #2034 into 5.12.0 (#2036) Partially revert "Update CHANGELOG for Firestore v0.14.0 (#2025)" (#2031) Revert "gRPC: replace Objective-C implementation with the new C++ implementation (#1968)" (#2030) Update CHANGELOG.md for #2034 (#2035) ...
2 parents aad9e42 + c2fd8d1 commit e46aefa

File tree

346 files changed

+76374
-42021
lines changed

Some content is hidden

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

346 files changed

+76374
-42021
lines changed

.travis.yml

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
os: osx
2-
osx_image: xcode9.4
2+
osx_image: xcode10
33
language: objective-c
44
cache:
55
- bundler
@@ -33,8 +33,14 @@ jobs:
3333
env:
3434
- PROJECT=Firebase PLATFORM=iOS METHOD=xcodebuild
3535
before_install:
36-
- npm install ios-sim -g
37-
- ios-sim start --devicetypeid "com.apple.CoreSimulator.SimDeviceType.iPhone-8-Plus, 11.3"
36+
- ./scripts/if_changed.sh ./scripts/install_prereqs.sh
37+
script:
38+
- ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM
39+
40+
- stage: test
41+
env:
42+
- PROJECT=InAppMessagingDisplay PLATFORM=iOS METHOD=xcodebuild
43+
before_install:
3844
- ./scripts/if_changed.sh ./scripts/install_prereqs.sh
3945
script:
4046
- ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM
@@ -64,6 +70,7 @@ jobs:
6470
- ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseMessaging.podspec
6571
- ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseStorage.podspec
6672
- ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseFunctions.podspec
73+
- ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseInAppMessagingDisplay.podspec
6774

6875
- stage: test
6976
env:
@@ -93,6 +100,7 @@ jobs:
93100
- ./scripts/if_cron.sh ./scripts/pod_lib_lint.sh FirebaseMessaging.podspec --use-libraries --allow-warnings
94101
- ./scripts/if_cron.sh ./scripts/pod_lib_lint.sh FirebaseStorage.podspec --use-libraries
95102
- ./scripts/if_cron.sh ./scripts/pod_lib_lint.sh FirebaseFunctions.podspec --use-libraries
103+
- ./scripts/if_cron.sh ./scripts/pod_lib_lint.sh FirebaseInAppMessagingDisplay.podspec --use-libraries
96104

97105
- stage: test
98106
env:
@@ -106,6 +114,36 @@ jobs:
106114

107115
# Alternative platforms
108116

117+
# Xcode 9
118+
- stage: test
119+
osx_image: xcode9.4
120+
env:
121+
- PROJECT=Firebase PLATFORM=iOS METHOD=xcodebuild
122+
before_install:
123+
- npm install ios-sim -g
124+
- ios-sim start --devicetypeid "com.apple.CoreSimulator.SimDeviceType.iPhone-8-Plus, 11.3"
125+
- ./scripts/if_changed.sh ./scripts/install_prereqs.sh
126+
script:
127+
- ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM
128+
129+
- stage: test
130+
osx_image: xcode9.4
131+
env:
132+
- PROJECT=InAppMessagingDisplay PLATFORM=iOS METHOD=xcodebuild
133+
before_install:
134+
- ./scripts/if_changed.sh ./scripts/install_prereqs.sh
135+
script:
136+
- ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM
137+
138+
- stage: test
139+
osx_image: xcode9.4
140+
env:
141+
- PROJECT=Firestore PLATFORM=iOS METHOD=xcodebuild
142+
before_install:
143+
- ./scripts/if_changed.sh ./scripts/install_prereqs.sh
144+
script:
145+
- ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM $METHOD
146+
109147
- stage: test
110148
env:
111149
- PROJECT=Firestore PLATFORM=macOS METHOD=cmake

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/MainViewController.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -861,11 +861,11 @@ - (void)updateTable {
861861
}],
862862
[StaticContentTableViewCell cellWithTitle:kUnlinkFromFacebook
863863
action:^{
864-
[weakSelf unlinkFromProvider:FIRGoogleAuthProviderID completion:nil];
864+
[weakSelf unlinkFromProvider:FIRFacebookAuthProviderID completion:nil];
865865
}],
866866
[StaticContentTableViewCell cellWithTitle:kUnlinkFromEmailPassword
867867
action:^{
868-
[weakSelf unlinkFromProvider:FIRGoogleAuthProviderID completion:nil];
868+
[weakSelf unlinkFromProvider:FIREmailAuthProviderID completion:nil];
869869
}]
870870
]],
871871
[StaticContentTableViewSection sectionWithTitle:kSectionTitleApp cells:@[

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)