Browse Source

Merge remote-tracking branch 'origin/master' into pb-merge-firebase7

Paul Beusterien 5 years ago
parent
commit
6a2b9a9556

+ 7 - 0
FirebaseAppDistribution/README.md

@@ -1,5 +1,12 @@
 # Firebase App Distribution SDK
 
+The Firebase App Distribution SDK lets you display in-app alerts to your testers when new builds are
+available to install.
+
+Please visit [our developer site](https://firebase.google.com/docs/app-distribution/set-up-alerts) for
+integration instructions, documentation, support information, and terms of
+service.
+
 ## Development
 
 ### Prereqs

+ 3 - 0
FirebaseAuth/CHANGELOG.md

@@ -1,3 +1,6 @@
+# Unreleased
+- [removed] Remove deprecated APIs `dataForKey`,`fetchProvidersForEmail:completion`, `signInAndRetrieveDataWithCredential:completion`, `reauthenticateAndRetrieveDataWithCredential:completion`, `linkAndRetrieveDataWithCredential:completion`. (#6607)
+
 # v6.9.1
 - [fixed] Internal source documentation. (#6371)
 

+ 0 - 36
FirebaseAuth/Sources/Auth/FIRAuth.m

@@ -207,15 +207,6 @@ static NSMutableDictionary *gKeychainServiceNameForAppName;
 
 @implementation FIRActionCodeInfo
 
-- (NSString *)dataForKey:(FIRActionDataKey)key {
-  switch (key) {
-    case FIRActionCodeEmailKey:
-      return self.email;
-    case FIRActionCodeFromEmailKey:
-      return self.previousEmail;
-  }
-}
-
 - (instancetype)initWithOperation:(FIRActionCodeOperation)operation
                             email:(NSString *)email
                          newEmail:(nullable NSString *)newEmail {
@@ -592,25 +583,6 @@ static NSMutableDictionary *gKeychainServiceNameForAppName;
   return result;
 }
 
-- (void)fetchProvidersForEmail:(NSString *)email
-                    completion:(nullable FIRProviderQueryCallback)completion {
-  dispatch_async(FIRAuthGlobalWorkQueue(), ^{
-    FIRCreateAuthURIRequest *request =
-        [[FIRCreateAuthURIRequest alloc] initWithIdentifier:email
-                                                continueURI:@"http://www.google.com/"
-                                       requestConfiguration:self->_requestConfiguration];
-    [FIRAuthBackend
-        createAuthURI:request
-             callback:^(FIRCreateAuthURIResponse *_Nullable response, NSError *_Nullable error) {
-               if (completion) {
-                 dispatch_async(dispatch_get_main_queue(), ^{
-                   completion(response.allProviders, error);
-                 });
-               }
-             }];
-  });
-}
-
 - (void)signInWithProvider:(id<FIRFederatedAuthProvider>)provider
                 UIDelegate:(nullable id<FIRAuthUIDelegate>)UIDelegate
                 completion:(nullable FIRAuthDataResultCallback)completion {
@@ -861,16 +833,8 @@ static NSMutableDictionary *gKeychainServiceNameForAppName;
              }];
 }
 
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
 - (void)signInWithCredential:(FIRAuthCredential *)credential
                   completion:(nullable FIRAuthDataResultCallback)completion {
-  [self signInAndRetrieveDataWithCredential:credential completion:completion];
-}
-#pragma clang diagnostic pop
-
-- (void)signInAndRetrieveDataWithCredential:(FIRAuthCredential *)credential
-                                 completion:(nullable FIRAuthDataResultCallback)completion {
   dispatch_async(FIRAuthGlobalWorkQueue(), ^{
     FIRAuthDataResultCallback callback =
         [self signInFlowAuthDataResultCallbackByDecoratingCallback:completion];

+ 0 - 40
FirebaseAuth/Sources/Public/FirebaseAuth/FIRAuth.h

@@ -176,19 +176,6 @@ typedef void (^FIRApplyActionCodeCallback)(NSError *_Nullable error)
 
 typedef void (^FIRAuthVoidErrorCallback)(NSError *_Nullable) NS_SWIFT_NAME(AuthVoidErrorCallback);
 
-/**
-    @brief Deprecated. Please directly use email or previousEmail properties instead.
-  */
-typedef NS_ENUM(NSInteger, FIRActionDataKey) {
-  /** Deprecated. Please directly use email property instead.  */
-  FIRActionCodeEmailKey = 0,
-
-  /** Deprecated. Please directly use previousEmail property instead. */
-  FIRActionCodeFromEmailKey = 1,
-
-} NS_SWIFT_NAME(ActionDataKey)
-    DEPRECATED_MSG_ATTRIBUTE("Please directly use email or previousEmail properties instead.");
-
 /** @class FIRActionCodeInfo
     @brief Manages information regarding action codes.
  */
@@ -227,12 +214,6 @@ typedef NS_ENUM(NSInteger, FIRActionCodeOperation) {
  */
 @property(nonatomic, readonly) FIRActionCodeOperation operation;
 
-/** @fn dataForKey:
-    @brief Deprecated. Please directly use email or previousEmail properties instead.
- */
-- (NSString *)dataForKey:(FIRActionDataKey)key
-    DEPRECATED_MSG_ATTRIBUTE("Please directly use email or previousEmail properties instead.");
-
 /** @property email
     @brief The email address to which the code was sent. The new email address in the case of
         FIRActionCodeOperationRecoverEmail.
@@ -388,16 +369,6 @@ NS_SWIFT_NAME(Auth)
 - (void)updateCurrentUser:(FIRUser *)user
                completion:(nullable void (^)(NSError *_Nullable error))completion;
 
-/** @fn fetchProvidersForEmail:completion:
-    @brief Please use fetchSignInMethodsForEmail:completion: for Objective-C or
-        fetchSignInMethods(forEmail:completion:) for Swift instead.
- */
-- (void)fetchProvidersForEmail:(NSString *)email
-                    completion:(nullable void (^)(NSArray<NSString *> *_Nullable providers,
-                                                  NSError *_Nullable error))completion
-    DEPRECATED_MSG_ATTRIBUTE("Please use fetchSignInMethodsForEmail:completion: for Objective-C or "
-                             "fetchSignInMethods(forEmail:completion:) for Swift instead.");
-
 /** @fn fetchSignInMethodsForEmail:completion:
     @brief Fetches the list of all sign-in methods previously used for the provided email address.
 
@@ -519,17 +490,6 @@ NS_SWIFT_NAME(Auth)
                                               NSError *_Nullable error))completion
     API_UNAVAILABLE(watchos);
 
-/** @fn signInAndRetrieveDataWithCredential:completion:
-    @brief Please use signInWithCredential:completion: for Objective-C or "
-        "signIn(with:completion:) for Swift instead.
- */
-- (void)signInAndRetrieveDataWithCredential:(FIRAuthCredential *)credential
-                                 completion:
-                                     (nullable void (^)(FIRAuthDataResult *_Nullable authResult,
-                                                        NSError *_Nullable error))completion
-    DEPRECATED_MSG_ATTRIBUTE("Please use signInWithCredential:completion: for Objective-C or "
-                             "signIn(with:completion:) for Swift instead.");
-
 /** @fn signInWithCredential:completion:
     @brief Asynchronously signs in to Firebase with the given 3rd-party credentials (e.g. a Facebook
         login Access Token, a Google ID Token/Access Token pair, etc.) and returns additional

+ 0 - 23
FirebaseAuth/Sources/Public/FirebaseAuth/FIRUser.h

@@ -275,18 +275,6 @@ NS_SWIFT_NAME(User)
                           completion:(nullable void (^)(FIRAuthDataResult *_Nullable authResult,
                                                         NSError *_Nullable error))completion;
 
-/** @fn reauthenticateAndRetrieveDataWithCredential:completion:
-    @brief Please use linkWithCredential:completion: for Objective-C
-        or link(withCredential:completion:) for Swift instead.
- */
-- (void)reauthenticateAndRetrieveDataWithCredential:(FIRAuthCredential *)credential
-                                         completion:(nullable void (^)(
-                                                        FIRAuthDataResult *_Nullable authResult,
-                                                        NSError *_Nullable error))completion
-    DEPRECATED_MSG_ATTRIBUTE("Please use reauthenticateWithCredential:completion: for"
-                             " Objective-C or reauthenticate(withCredential:completion:)"
-                             " for Swift instead.");
-
 /** @fn reauthenticateWithProvider:UIDelegate:completion:
     @brief Renews the user's authentication using the provided auth provider instance.
 
@@ -362,17 +350,6 @@ NS_SWIFT_NAME(User)
                       completion:(nullable void (^)(NSString *_Nullable token,
                                                     NSError *_Nullable error))completion;
 
-/** @fn linkAndRetrieveDataWithCredential:completion:
-    @brief Please use linkWithCredential:completion: for Objective-C
-        or link(withCredential:completion:) for Swift instead.
- */
-- (void)linkAndRetrieveDataWithCredential:(FIRAuthCredential *)credential
-                               completion:
-                                   (nullable void (^)(FIRAuthDataResult *_Nullable authResult,
-                                                      NSError *_Nullable error))completion
-    DEPRECATED_MSG_ATTRIBUTE("Please use linkWithCredential:completion: for Objective-C "
-                             "or link(withCredential:completion:) for Swift instead.");
-
 /** @fn linkWithCredential:completion:
     @brief Associates a user account from a third-party identity provider with this user and
         returns additional identity provider data.

+ 0 - 16
FirebaseAuth/Sources/User/FIRUser.m

@@ -787,16 +787,8 @@ static void callInMainThreadWithAuthDataResultAndError(
 
 #pragma mark -
 
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
 - (void)reauthenticateWithCredential:(FIRAuthCredential *)credential
                           completion:(nullable FIRAuthDataResultCallback)completion {
-  [self reauthenticateAndRetrieveDataWithCredential:credential completion:completion];
-}
-#pragma clang diagnostic pop
-
-- (void)reauthenticateAndRetrieveDataWithCredential:(FIRAuthCredential *)credential
-                                         completion:(nullable FIRAuthDataResultCallback)completion {
   dispatch_async(FIRAuthGlobalWorkQueue(), ^{
     [self->_auth
         internalSignInAndRetrieveDataWithCredential:credential
@@ -1056,16 +1048,8 @@ static void callInMainThreadWithAuthDataResultAndError(
   });
 }
 
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
 - (void)linkWithCredential:(FIRAuthCredential *)credential
                 completion:(nullable FIRAuthDataResultCallback)completion {
-  [self linkAndRetrieveDataWithCredential:credential completion:completion];
-}
-#pragma clang diagnostic pop
-
-- (void)linkAndRetrieveDataWithCredential:(FIRAuthCredential *)credential
-                               completion:(nullable FIRAuthDataResultCallback)completion {
   dispatch_async(FIRAuthGlobalWorkQueue(), ^{
     if (self->_providerData[credential.provider]) {
       callInMainThreadWithAuthDataResultAndError(completion, nil,

+ 0 - 29
FirebaseAuth/Tests/Sample/Sample/MainViewController+User.m

@@ -35,8 +35,6 @@ NS_ASSUME_NONNULL_BEGIN
                                       action:^{ [weakSelf updatePassword]; }],
     [StaticContentTableViewCell cellWithTitle:@"Update Phone Number"
                                       action:^{ [weakSelf updatePhoneNumber]; }],
-    [StaticContentTableViewCell cellWithTitle:@"Get Provider IDs for Email"
-                                      action:^{ [weakSelf getProvidersForEmail]; }],
     [StaticContentTableViewCell cellWithTitle:@"Get Sign-in methods for Email"
                                       action:^{ [weakSelf getAllSignInMethodsForEmail]; }],
     [StaticContentTableViewCell cellWithTitle:@"Reload User"
@@ -112,33 +110,6 @@ NS_ASSUME_NONNULL_BEGIN
   }];
 }
 
-- (void)getProvidersForEmail {
-  [self showTextInputPromptWithMessage:@"Email:"
-                       completionBlock:^(BOOL userPressedOK, NSString *_Nullable userInput) {
-   if (!userPressedOK || !userInput.length) {
-     return;
-   }
-   [self showSpinner:^{
-     [[AppManager auth] fetchProvidersForEmail:userInput
-                                    completion:^(NSArray<NSString *> *_Nullable providers,
-                                                 NSError *_Nullable error) {
-      if (error) {
-        [self logFailure:@"get providers for email failed" error:error];
-      } else {
-        [self logSuccess:@"get providers for email succeeded."];
-      }
-      [self hideSpinner:^{
-        if (error) {
-          [self showMessagePrompt:error.localizedDescription];
-          return;
-        }
-        [self showMessagePrompt:[providers componentsJoinedByString:@", "]];
-      }];
-    }];
-   }];
- }];
-}
-
 - (void)getAllSignInMethodsForEmail {
   [self showTextInputPromptWithMessage:@"Email:"
                        completionBlock:^(BOOL userPressedOK, NSString *_Nullable userInput) {

+ 3 - 60
FirebaseAuth/Tests/Unit/FIRAuthTests.m

@@ -378,39 +378,6 @@ static const NSTimeInterval kWaitInterval = .5;
 
 #pragma mark - Server API Tests
 
-/** @fn testFetchProvidersForEmailSuccess
-    @brief Tests the flow of a successful @c fetchProvidersForEmail:completion: call.
- */
-- (void)testFetchProvidersForEmailSuccess {
-  NSArray<NSString *> *allProviders = @[ FIRGoogleAuthProviderID, FIREmailAuthProviderID ];
-  OCMExpect([_mockBackend createAuthURI:[OCMArg any] callback:[OCMArg any]])
-      .andCallBlock2(
-          ^(FIRCreateAuthURIRequest *_Nullable request, FIRCreateAuthURIResponseCallback callback) {
-            XCTAssertEqualObjects(request.identifier, kEmail);
-            XCTAssertNotNil(request.endpoint);
-            XCTAssertEqualObjects(request.APIKey, kAPIKey);
-            dispatch_async(FIRAuthGlobalWorkQueue(), ^() {
-              id mockCreateAuthURIResponse = OCMClassMock([FIRCreateAuthURIResponse class]);
-              OCMStub([mockCreateAuthURIResponse allProviders]).andReturn(allProviders);
-              callback(mockCreateAuthURIResponse, nil);
-            });
-          });
-  XCTestExpectation *expectation = [self expectationWithDescription:@"callback"];
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-  [[FIRAuth auth]
-      fetchProvidersForEmail:kEmail
-                  completion:^(NSArray<NSString *> *_Nullable providers, NSError *_Nullable error) {
-#pragma clang diagnostic pop
-                    XCTAssertTrue([NSThread isMainThread]);
-                    XCTAssertEqualObjects(providers, allProviders);
-                    XCTAssertNil(error);
-                    [expectation fulfill];
-                  }];
-  [self waitForExpectationsWithTimeout:kExpectationTimeout handler:nil];
-  OCMVerifyAll(_mockBackend);
-}
-
 /** @fn testFetchSignInMethodsForEmailSuccess
     @brief Tests the flow of a successful @c fetchSignInMethodsForEmail:completion: call.
  */
@@ -443,30 +410,6 @@ static const NSTimeInterval kWaitInterval = .5;
   OCMVerifyAll(_mockBackend);
 }
 
-/** @fn testFetchProvidersForEmailFailure
-    @brief Tests the flow of a failed @c fetchProvidersForEmail:completion: call.
- */
-- (void)testFetchProvidersForEmailFailure {
-  OCMExpect([_mockBackend createAuthURI:[OCMArg any] callback:[OCMArg any]])
-      .andDispatchError2([FIRAuthErrorUtils tooManyRequestsErrorWithMessage:nil]);
-  XCTestExpectation *expectation = [self expectationWithDescription:@"callback"];
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-  [[FIRAuth auth]
-      fetchProvidersForEmail:kEmail
-                  completion:^(NSArray<NSString *> *_Nullable providers, NSError *_Nullable error) {
-
-#pragma clang pop
-                    XCTAssertTrue([NSThread isMainThread]);
-                    XCTAssertNil(providers);
-                    XCTAssertEqual(error.code, FIRAuthErrorCodeTooManyRequests);
-                    XCTAssertNotNil(error.userInfo[NSLocalizedDescriptionKey]);
-                    [expectation fulfill];
-                  }];
-  [self waitForExpectationsWithTimeout:kExpectationTimeout handler:nil];
-  OCMVerifyAll(_mockBackend);
-}
-
 /** @fn testFetchSignInMethodsForEmailFailure
     @brief Tests the flow of a failed @c fetchSignInMethodsForEmail:completion: call.
  */
@@ -1363,11 +1306,11 @@ static const NSTimeInterval kWaitInterval = .5;
 }
 #endif  // TARGET_OS_IOS
 
-/** @fn testSignInAndRetrieveDataWithCredentialSuccess
-    @brief Tests the flow of a successful @c signInAndRetrieveDataWithCredential:completion: call
+/** @fn testSignInWithCredentialSuccess
+    @brief Tests the flow of a successful @c signInWithCredential:completion: call
         with an Google Sign-In credential.
  */
-- (void)testSignInAndRetrieveDataWithCredentialSuccess {
+- (void)testSignInWithCredentialSuccess {
   OCMExpect([_mockBackend verifyAssertion:[OCMArg any] callback:[OCMArg any]])
       .andCallBlock2(^(FIRVerifyAssertionRequest *_Nullable request,
                        FIRVerifyAssertionResponseCallback callback) {

+ 14 - 14
FirebaseAuth/Tests/Unit/FIRUserTests.m

@@ -1637,11 +1637,11 @@ static const NSTimeInterval kExpectationTimeout = 2;
   OCMVerifyAll(_mockBackend);
 }
 
-/** @fn testReauthenticateAndRetrieveDataSuccess
-    @brief Tests the flow of a successful @c reauthenticateAndRetrieveDataWithCredential:completion:
+/** @fn testReauthenticateWithCredentialSuccess
+    @brief Tests the flow of a successful @c reauthenticateWithCredential:completion:
         call.
  */
-- (void)testReauthenticateAndRetrieveDataSuccess {
+- (void)testReauthenticateWithCredentialSuccess {
   [self expectVerifyAssertionRequest:FIRGoogleAuthProviderID
                          federatedID:kGoogleID
                          displayName:kGoogleDisplayName
@@ -1864,7 +1864,7 @@ static const NSTimeInterval kExpectationTimeout = 2;
 }
 
 /** @fn testlinkAndRetrieveDataSuccess
-    @brief Tests the flow of a successful @c linkAndRetrieveDataWithCredential:completion:
+    @brief Tests the flow of a successful @c linkWithCredential:completion:
         call.
  */
 - (void)testlinkAndRetrieveDataSuccess {
@@ -1932,7 +1932,7 @@ static const NSTimeInterval kExpectationTimeout = 2;
 }
 
 /** @fn testlinkAndRetrieveDataError
-    @brief Tests the flow of an unsuccessful @c linkAndRetrieveDataWithCredential:completion:
+    @brief Tests the flow of an unsuccessful @c linkWithCredential:completion:
         call with an error from the backend.
  */
 - (void)testlinkAndRetrieveDataError {
@@ -1992,7 +1992,7 @@ static const NSTimeInterval kExpectationTimeout = 2;
 }
 
 /** @fn testlinkAndRetrieveDataProviderAlreadyLinked
-    @brief Tests the flow of an unsuccessful @c linkAndRetrieveDataWithCredential:completion:
+    @brief Tests the flow of an unsuccessful @c linkWithCredential:completion:
         call with FIRAuthErrorCodeProviderAlreadyLinked, which is a client side error.
  */
 - (void)testlinkAndRetrieveDataProviderAlreadyLinked {
@@ -2036,7 +2036,7 @@ static const NSTimeInterval kExpectationTimeout = 2;
 }
 
 /** @fn testlinkAndRetrieveDataErrorAutoSignOut
-    @brief Tests the flow of an unsuccessful @c linkAndRetrieveDataWithCredential:completion:
+    @brief Tests the flow of an unsuccessful @c linkWithCredential:completion:
         call that automatically signs out.
  */
 - (void)testlinkAndRetrieveDataErrorAutoSignOut {
@@ -2089,7 +2089,7 @@ static const NSTimeInterval kExpectationTimeout = 2;
 }
 
 /** @fn testlinkEmailAndRetrieveDataSuccess
-    @brief Tests the flow of a successful @c linkAndRetrieveDataWithCredential:completion:
+    @brief Tests the flow of a successful @c linkWithCredential:completion:
         invocation for email credential.
  */
 - (void)testlinkEmailAndRetrieveDataSuccess {
@@ -2163,7 +2163,7 @@ static const NSTimeInterval kExpectationTimeout = 2;
 }
 
 /** @fn testlinkEmailProviderAlreadyLinkedError
-    @brief Tests the flow of an unsuccessful @c linkAndRetrieveDataWithCredential:completion:
+    @brief Tests the flow of an unsuccessful @c linkWithCredential:completion:
         invocation for email credential and FIRAuthErrorCodeProviderAlreadyLinked which is a client
         side error.
  */
@@ -2250,7 +2250,7 @@ static const NSTimeInterval kExpectationTimeout = 2;
 }
 
 /** @fn testlinkEmailAndRetrieveDataError
-    @brief Tests the flow of an unsuccessful @c linkAndRetrieveDataWithCredential:completion:
+    @brief Tests the flow of an unsuccessful @c linkWithCredential:completion:
         invocation for email credential and an error from the backend.
  */
 - (void)testlinkEmailAndRetrieveDataError {
@@ -2305,7 +2305,7 @@ static const NSTimeInterval kExpectationTimeout = 2;
 }
 
 /** @fn testlinkEmailAndRetrieveDataError
-    @brief Tests the flow of an unsuccessful @c linkAndRetrieveDataWithCredential:completion:
+    @brief Tests the flow of an unsuccessful @c linkWithCredential:completion:
         invocation that automatically signs out.
  */
 - (void)testlinkEmailAndRetrieveDataErrorAutoSignOut {
@@ -2510,7 +2510,7 @@ static const NSTimeInterval kExpectationTimeout = 2;
 
 #if TARGET_OS_IOS
 /** @fn testlinkPhoneAuthCredentialSuccess
-    @brief Tests the flow of a successful @c linkAndRetrieveDataWithCredential:completion:
+    @brief Tests the flow of a successful @c linkWithCredential:completion:
         call using a phoneAuthCredential.
  */
 - (void)testlinkPhoneAuthCredentialSuccess {
@@ -2668,7 +2668,7 @@ static const NSTimeInterval kExpectationTimeout = 2;
 }
 
 /** @fn testlinkPhoneAuthCredentialFailure
-    @brief Tests the flow of a failed call to @c linkAndRetrieveDataWithCredential:completion: due
+    @brief Tests the flow of a failed call to @c linkWithCredential:completion: due
         to a phone provider already being linked.
  */
 - (void)testlinkPhoneAuthCredentialFailure {
@@ -2716,7 +2716,7 @@ static const NSTimeInterval kExpectationTimeout = 2;
 }
 
 /** @fn testlinkPhoneCredentialAlreadyExistsError
-    @brief Tests the flow of @c linkAndRetrieveDataWithCredential:completion:
+    @brief Tests the flow of @c linkWithCredential:completion:
         call using a phoneAuthCredential and a credential already exisits error. In this case we
         should get a FIRAuthCredential in the error object.
  */

+ 0 - 37
FirebaseRemoteConfig/Tests/FakeConsole/FakeConsoleTests.swift

@@ -23,43 +23,6 @@ class FakeConsoleTests: APITestBase {
     fakeConsole.config = ["Key1": "Value1"]
   }
 
-  // Test old API.
-  // Contrast with testUnchangedActivateWillError in APITests.swift.
-  func testChangedActivateWillNotError() {
-    let expectation = self.expectation(description: #function)
-    config.fetch { status, error in
-      if let error = error {
-        XCTFail("Fetch Error \(error)")
-      }
-      XCTAssertEqual(status, RemoteConfigFetchStatus.success)
-      self.config.activate { error in
-        if let error = error {
-          print("Activate Error \(error)")
-        }
-        XCTAssertEqual(self.config["Key1"].stringValue, "Value1")
-        expectation.fulfill()
-      }
-    }
-    waitForExpectations()
-
-    // Simulate updating console.
-    fakeConsole.config = ["Key1": "Value2"]
-
-    let expectation2 = self.expectation(description: #function + "2")
-    config.fetch { status, error in
-      if let error = error {
-        XCTFail("Fetch Error \(error)")
-      }
-      XCTAssertEqual(status, RemoteConfigFetchStatus.success)
-      self.config.activate { error in
-        XCTAssertNil(error)
-        XCTAssertEqual(self.config["Key1"].stringValue, "Value2")
-        expectation2.fulfill()
-      }
-    }
-    waitForExpectations()
-  }
-
   // Test New API.
   // Contrast with testUnchangedActivateWillFlag in APITests.swift.
   func testChangedActivateWillNotFlag() {

+ 0 - 36
FirebaseRemoteConfig/Tests/SwiftAPI/APITests.swift

@@ -95,42 +95,6 @@ class APITests: APITestBase {
     waitForExpectations()
   }
 
-  // Test old API.
-  // Contrast with testChangedActivateWillNotError in FakeConsole.swift.
-  func testUnchangedActivateWillError() {
-    let expectation = self.expectation(description: #function)
-    config.fetch { status, error in
-      if let error = error {
-        XCTFail("Fetch Error \(error)")
-      }
-      XCTAssertEqual(status, RemoteConfigFetchStatus.success)
-      self.config.activate { error in
-        if let error = error {
-          print("Activate Error \(error)")
-        }
-        XCTAssertEqual(self.config[Constants.key1].stringValue, Constants.value1)
-        expectation.fulfill()
-      }
-    }
-    waitForExpectations()
-    let expectation2 = self.expectation(description: #function + "2")
-    config.fetch { status, error in
-      if let error = error {
-        XCTFail("Fetch Error \(error)")
-      }
-      XCTAssertEqual(status, RemoteConfigFetchStatus.success)
-      self.config.activate { error in
-        XCTAssertNotNil(error)
-        if let error = error {
-          XCTAssertEqual((error as NSError).code, RemoteConfigError.internalError.rawValue)
-        }
-        XCTAssertEqual(self.config[Constants.key1].stringValue, Constants.value1)
-        expectation2.fulfill()
-      }
-    }
-    waitForExpectations()
-  }
-
   // Test New API.
   // Contrast with testChangedActivateWillNotFlag in FakeConsole.swift.
   func testUnchangedActivateWillFlag() {

+ 190 - 331
FirebaseRemoteConfig/Tests/Unit/RCNRemoteConfigTest.m

@@ -277,27 +277,26 @@ typedef NS_ENUM(NSInteger, RCNTestRCInstance) {
                                                            NSError *error) {
       XCTAssertEqual(self->_configInstances[i].lastFetchStatus, FIRRemoteConfigFetchStatusSuccess);
       XCTAssertNil(error);
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-      XCTAssertTrue([self->_configInstances[i] activateFetched]);
-#pragma clang diagnostic pop
-      NSString *key1 = [NSString stringWithFormat:@"key1-%d", i];
-      NSString *key2 = [NSString stringWithFormat:@"key2-%d", i];
-      NSString *value1 = [NSString stringWithFormat:@"value1-%d", i];
-      NSString *value2 = [NSString stringWithFormat:@"value2-%d", i];
-      XCTAssertEqualObjects(self->_configInstances[i][key1].stringValue, value1);
-      XCTAssertEqualObjects(self->_configInstances[i][key2].stringValue, value2);
+      [self->_configInstances[i] activateWithCompletion:^(BOOL changed, NSError *_Nullable error) {
+        XCTAssertTrue(changed);
+        NSString *key1 = [NSString stringWithFormat:@"key1-%d", i];
+        NSString *key2 = [NSString stringWithFormat:@"key2-%d", i];
+        NSString *value1 = [NSString stringWithFormat:@"value1-%d", i];
+        NSString *value2 = [NSString stringWithFormat:@"value2-%d", i];
+        XCTAssertEqualObjects(self->_configInstances[i][key1].stringValue, value1);
+        XCTAssertEqualObjects(self->_configInstances[i][key2].stringValue, value2);
 
-      OCMVerify([self->_configInstances[i] objectForKeyedSubscript:key1]);
+        OCMVerify([self->_configInstances[i] objectForKeyedSubscript:key1]);
 
-      XCTAssertEqual(status, FIRRemoteConfigFetchStatusSuccess,
-                     @"Callback of first successful config "
-                     @"fetch. Status must equal to FIRRemoteConfigFetchStatusSuccessFresh.");
+        XCTAssertEqual(status, FIRRemoteConfigFetchStatusSuccess,
+                       @"Callback of first successful config "
+                       @"fetch. Status must equal to FIRRemoteConfigFetchStatusSuccessFresh.");
 
-      XCTAssertNotNil(self->_configInstances[i].lastFetchTime);
-      XCTAssertGreaterThan(self->_configInstances[i].lastFetchTime.timeIntervalSince1970, 0,
-                           @"last fetch time interval should be set.");
-      [expectations[i] fulfill];
+        XCTAssertNotNil(self->_configInstances[i].lastFetchTime);
+        XCTAssertGreaterThan(self->_configInstances[i].lastFetchTime.timeIntervalSince1970, 0,
+                             @"last fetch time interval should be set.");
+        [expectations[i] fulfill];
+      }];
     };
     [_configInstances[i] fetchWithExpirationDuration:43200 completionHandler:fetchCompletion];
   }
@@ -367,7 +366,8 @@ typedef NS_ENUM(NSInteger, RCNTestRCInstance) {
                                                        NSError *error) {
       XCTAssertEqual(self->_configInstances[i].lastFetchStatus, FIRRemoteConfigFetchStatusSuccess);
       XCTAssertNil(error);
-      [self->_configInstances[i] activateWithCompletionHandler:^(NSError *_Nullable error) {
+      [self->_configInstances[i] activateWithCompletion:^(BOOL changed, NSError *_Nullable error) {
+        XCTAssertTrue(changed);
         XCTAssertNil(error);
         NSString *key1 = [NSString stringWithFormat:@"key1-%d", i];
         NSString *key2 = [NSString stringWithFormat:@"key2-%d", i];
@@ -385,11 +385,13 @@ typedef NS_ENUM(NSInteger, RCNTestRCInstance) {
         XCTAssertNotNil(self->_configInstances[i].lastFetchTime);
         XCTAssertGreaterThan(self->_configInstances[i].lastFetchTime.timeIntervalSince1970, 0,
                              @"last fetch time interval should be set.");
-        // A second activate should return an error.
-        [self->_configInstances[i] activateWithCompletionHandler:^(NSError *_Nullable error) {
-          XCTAssertNotNil(error);
-          XCTAssertEqualObjects(error.domain, FIRRemoteConfigErrorDomain);
-        }];
+
+        // A second activate should have no effect.
+        [self->_configInstances[i]
+            activateWithCompletion:^(BOOL changed, NSError *_Nullable error) {
+              XCTAssertFalse(changed);
+              XCTAssertNil(error);
+            }];
         [expectations[i] fulfill];
       }];
     };
@@ -414,36 +416,35 @@ typedef NS_ENUM(NSInteger, RCNTestRCInstance) {
                                                            NSError *error) {
       XCTAssertEqual(self->_configInstances[i].lastFetchStatus, FIRRemoteConfigFetchStatusSuccess);
       XCTAssertNil(error);
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-      XCTAssertTrue([self->_configInstances[i] activateFetched]);
-#pragma clang diagnostic pop
-      NSString *key5 = [NSString stringWithFormat:@"key5-%d", i];
-      NSString *key19 = [NSString stringWithFormat:@"key19-%d", i];
-      NSString *value5 = [NSString stringWithFormat:@"value5-%d", i];
-      NSString *value19 = [NSString stringWithFormat:@"value19-%d", i];
-
-      XCTAssertEqualObjects(self->_configInstances[i][key5].stringValue, value5);
-      XCTAssertEqualObjects(self->_configInstances[i][key19].stringValue, value19);
-
-      // Test enumerating config values.
-      for (NSString *key in self->_configInstances[i]) {
-        if ([key isEqualToString:key5]) {
-          XCTAssertEqualObjects(self->_configInstances[i][key5].stringValue, value5);
-        }
-        if ([key isEqualToString:key19]) {
-          XCTAssertEqualObjects(self->_configInstances[i][key19].stringValue, value19);
+      [self->_configInstances[i] activateWithCompletion:^(BOOL changed, NSError *_Nullable error) {
+        XCTAssertTrue(changed);
+        NSString *key5 = [NSString stringWithFormat:@"key5-%d", i];
+        NSString *key19 = [NSString stringWithFormat:@"key19-%d", i];
+        NSString *value5 = [NSString stringWithFormat:@"value5-%d", i];
+        NSString *value19 = [NSString stringWithFormat:@"value19-%d", i];
+
+        XCTAssertEqualObjects(self->_configInstances[i][key5].stringValue, value5);
+        XCTAssertEqualObjects(self->_configInstances[i][key19].stringValue, value19);
+
+        // Test enumerating config values.
+        for (NSString *key in self->_configInstances[i]) {
+          if ([key isEqualToString:key5]) {
+            XCTAssertEqualObjects(self->_configInstances[i][key5].stringValue, value5);
+          }
+          if ([key isEqualToString:key19]) {
+            XCTAssertEqualObjects(self->_configInstances[i][key19].stringValue, value19);
+          }
         }
-      }
-      XCTAssertEqual(status, FIRRemoteConfigFetchStatusSuccess,
-                     @"Callback of first successful config "
-                     @"fetch. Status must equal to FIRRemoteConfigFetchStatusSuccessFresh.");
+        XCTAssertEqual(status, FIRRemoteConfigFetchStatusSuccess,
+                       @"Callback of first successful config "
+                       @"fetch. Status must equal to FIRRemoteConfigFetchStatusSuccessFresh.");
 
-      XCTAssertNotNil(self->_configInstances[i].lastFetchTime);
-      XCTAssertGreaterThan(self->_configInstances[i].lastFetchTime.timeIntervalSince1970, 0,
-                           @"last fetch time interval should be set.");
+        XCTAssertNotNil(self->_configInstances[i].lastFetchTime);
+        XCTAssertGreaterThan(self->_configInstances[i].lastFetchTime.timeIntervalSince1970, 0,
+                             @"last fetch time interval should be set.");
 
-      [expectations[i] fulfill];
+        [expectations[i] fulfill];
+      }];
     };
     [_configInstances[i] fetchWithExpirationDuration:43200 completionHandler:fetchCompletion];
   }
@@ -544,8 +545,6 @@ typedef NS_ENUM(NSInteger, RCNTestRCInstance) {
                                                configSettings:settings
                                              configExperiment:nil];
   }
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
   // Make the fetch calls for all instances.
   NSMutableArray<XCTestExpectation *> *expectations =
       [[NSMutableArray alloc] initWithCapacity:RCNTestRCNumTotalInstances];
@@ -558,14 +557,15 @@ typedef NS_ENUM(NSInteger, RCNTestRCInstance) {
     FIRRemoteConfigFetchCompletion fetchCompletion = ^void(FIRRemoteConfigFetchStatus status,
                                                            NSError *error) {
       XCTAssertEqual(self->_configInstances[i].lastFetchStatus, FIRRemoteConfigFetchStatusFailure);
-      XCTAssertFalse([self->_configInstances[i] activateFetched]);
-      XCTAssertNotNil(error);
-      // No such key, still return a static value.
-      FIRRemoteConfigValue *value = self->_configInstances[RCNTestRCInstanceDefault][@"key1"];
-      XCTAssertEqual((int)value.source, (int)FIRRemoteConfigSourceStatic);
-      XCTAssertEqualObjects(value.stringValue, @"");
-      XCTAssertEqual(value.boolValue, NO);
-      [expectations[i] fulfill];
+      [self->_configInstances[i] activateWithCompletion:^(BOOL changed, NSError *_Nullable error) {
+        XCTAssertFalse(changed);
+        XCTAssertNil(error);
+        FIRRemoteConfigValue *value = self->_configInstances[RCNTestRCInstanceDefault][@"key1"];
+        XCTAssertEqual((int)value.source, (int)FIRRemoteConfigSourceStatic);
+        XCTAssertEqualObjects(value.stringValue, @"");
+        XCTAssertEqual(value.boolValue, NO);
+        [expectations[i] fulfill];
+      }];
     };
     [_configInstances[i] fetchWithExpirationDuration:43200 completionHandler:fetchCompletion];
   }
@@ -668,8 +668,6 @@ typedef NS_ENUM(NSInteger, RCNTestRCInstance) {
                                                configSettings:settings
                                              configExperiment:nil];
   }
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
   // Make the fetch calls for all instances.
   NSMutableArray<XCTestExpectation *> *expectations =
       [[NSMutableArray alloc] initWithCapacity:RCNTestRCNumTotalInstances];
@@ -682,14 +680,16 @@ typedef NS_ENUM(NSInteger, RCNTestRCInstance) {
     FIRRemoteConfigFetchCompletion fetchCompletion = ^void(FIRRemoteConfigFetchStatus status,
                                                            NSError *error) {
       XCTAssertEqual(self->_configInstances[i].lastFetchStatus, FIRRemoteConfigFetchStatusFailure);
-      XCTAssertFalse([self->_configInstances[i] activateFetched]);
-      XCTAssertNotNil(error);
-      // No such key, still return a static value.
-      FIRRemoteConfigValue *value = self->_configInstances[RCNTestRCInstanceDefault][@"key1"];
-      XCTAssertEqual((int)value.source, (int)FIRRemoteConfigSourceStatic);
-      XCTAssertEqualObjects(value.stringValue, @"");
-      XCTAssertEqual(value.boolValue, NO);
-      [expectations[i] fulfill];
+      [self->_configInstances[i] activateWithCompletion:^(BOOL changed, NSError *_Nullable error) {
+        XCTAssertFalse(changed);
+        XCTAssertNil(error);
+        // No such key, still return a static value.
+        FIRRemoteConfigValue *value = self->_configInstances[RCNTestRCInstanceDefault][@"key1"];
+        XCTAssertEqual((int)value.source, (int)FIRRemoteConfigSourceStatic);
+        XCTAssertEqualObjects(value.stringValue, @"");
+        XCTAssertEqual(value.boolValue, NO);
+        [expectations[i] fulfill];
+      }];
     };
     [_configInstances[i] fetchWithExpirationDuration:43200 completionHandler:fetchCompletion];
   }
@@ -797,8 +797,6 @@ typedef NS_ENUM(NSInteger, RCNTestRCInstance) {
                                                configSettings:settings
                                              configExperiment:nil];
   }
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
   // Make the fetch calls for all instances.
   NSMutableArray<XCTestExpectation *> *expectations =
       [[NSMutableArray alloc] initWithCapacity:RCNTestRCNumTotalInstances];
@@ -813,9 +811,11 @@ typedef NS_ENUM(NSInteger, RCNTestRCInstance) {
     FIRRemoteConfigFetchCompletion fetchCompletion = ^void(FIRRemoteConfigFetchStatus status,
                                                            NSError *error) {
       XCTAssertEqual(self->_configInstances[i].lastFetchStatus, FIRRemoteConfigFetchStatusSuccess);
-      XCTAssertFalse([self->_configInstances[i] activateFetched]);
-      XCTAssertNil(error);
-      [expectations[i] fulfill];
+      [self->_configInstances[i] activateWithCompletion:^(BOOL changed, NSError *_Nullable error) {
+        XCTAssertFalse(changed);
+        XCTAssertNil(error);
+        [expectations[i] fulfill];
+      }];
     };
     [_configInstances[i] fetchWithExpirationDuration:43200 completionHandler:fetchCompletion];
   }
@@ -837,39 +837,38 @@ typedef NS_ENUM(NSInteger, RCNTestRCInstance) {
                                                            NSError *error) {
       XCTAssertEqual(status, FIRRemoteConfigFetchStatusSuccess);
       XCTAssertNil(error);
-      XCTAssertTrue([self->_configInstances[i] activateFetched]);
+      [self->_configInstances[i] activateWithCompletion:^(BOOL changed, NSError *_Nullable error) {
+        XCTAssertTrue(changed);
+        NSString *key1 = [NSString stringWithFormat:@"key1-%d", i];
+        NSString *key2 = [NSString stringWithFormat:@"key2-%d", i];
+        NSString *key3 = [NSString stringWithFormat:@"key3-%d", i];
+        NSString *key7 = [NSString stringWithFormat:@"key7-%d", i];
+        NSString *value1 = [NSString stringWithFormat:@"value1-%d", i];
+        NSString *value2 = [NSString stringWithFormat:@"value2-%d", i];
+        NSString *value3 = [NSString stringWithFormat:@"value3-%d", i];
+        NSString *value7 = [NSString stringWithFormat:@"value7-%d", i];
+        XCTAssertEqualObjects(self->_configInstances[i][key1].stringValue, value1);
+        XCTAssertEqualObjects(self->_configInstances[i][key2].stringValue, value2);
+        OCMVerify([self->_configInstances[i] objectForKeyedSubscript:key1]);
+        XCTAssertEqualObjects([self->_configInstances[i] configValueForKey:key3].stringValue,
+                              value3);
+        if (i == RCNTestRCInstanceDefault) {
+          XCTAssertEqualObjects([self->_configInstances[i] configValueForKey:key7].stringValue,
+                                value7);
+        }
 
-      NSString *key1 = [NSString stringWithFormat:@"key1-%d", i];
-      NSString *key2 = [NSString stringWithFormat:@"key2-%d", i];
-      NSString *key3 = [NSString stringWithFormat:@"key3-%d", i];
-      NSString *key7 = [NSString stringWithFormat:@"key7-%d", i];
-      NSString *value1 = [NSString stringWithFormat:@"value1-%d", i];
-      NSString *value2 = [NSString stringWithFormat:@"value2-%d", i];
-      NSString *value3 = [NSString stringWithFormat:@"value3-%d", i];
-      NSString *value7 = [NSString stringWithFormat:@"value7-%d", i];
-      XCTAssertEqualObjects(self->_configInstances[i][key1].stringValue, value1);
-      XCTAssertEqualObjects(self->_configInstances[i][key2].stringValue, value2);
-      OCMVerify([self->_configInstances[i] objectForKeyedSubscript:key1]);
-      XCTAssertEqualObjects([self->_configInstances[i] configValueForKey:key3].stringValue, value3);
-      if (i == RCNTestRCInstanceDefault) {
-        XCTAssertEqualObjects(
-            [self->_configInstances[i] configValueForKey:key7
-                                               namespace:FIRNamespaceGoogleMobilePlatform]
-                .stringValue,
-            value7);
-      }
-
-      XCTAssertEqualObjects([self->_configInstances[i] configValueForKey:key7].stringValue, value7);
-      XCTAssertNotNil([self->_configInstances[i] configValueForKey:nil]);
-      XCTAssertEqual([self->_configInstances[i] configValueForKey:nil].source,
-                     FIRRemoteConfigSourceStatic);
-      XCTAssertEqual([self->_configInstances[i] configValueForKey:nil namespace:nil].source,
-                     FIRRemoteConfigSourceStatic);
-      XCTAssertEqual(
-          [self->_configInstances[i] configValueForKey:nil namespace:nil source:-1].source,
-          FIRRemoteConfigSourceStatic);
+        XCTAssertEqualObjects([self->_configInstances[i] configValueForKey:key7].stringValue,
+                              value7);
+        XCTAssertNotNil([self->_configInstances[i] configValueForKey:nil]);
+        XCTAssertEqual([self->_configInstances[i] configValueForKey:nil].source,
+                       FIRRemoteConfigSourceStatic);
+        XCTAssertEqual([self->_configInstances[i] configValueForKey:nil].source,
+                       FIRRemoteConfigSourceStatic);
+        XCTAssertEqual([self->_configInstances[i] configValueForKey:nil source:-1].source,
+                       FIRRemoteConfigSourceStatic);
 
-      [expectations[i] fulfill];
+        [expectations[i] fulfill];
+      }];
     };
     [_configInstances[i] fetchWithExpirationDuration:43200 completionHandler:fetchCompletion];
   }
@@ -901,25 +900,21 @@ typedef NS_ENUM(NSInteger, RCNTestRCInstance) {
       XCTAssertNil(error);
       XCTAssertEqualObjects(self->_configInstances[i][key1].stringValue, @"default key1");
       XCTAssertEqual(self->_configInstances[i][key1].source, FIRRemoteConfigSourceDefault);
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-      XCTAssertTrue([self->_configInstances[i] activateFetched]);
-#pragma clang diagnostic pop
-      XCTAssertEqualObjects(self->_configInstances[i][key1].stringValue, value1);
-      XCTAssertEqual(self->_configInstances[i][key1].source, FIRRemoteConfigSourceRemote);
-      XCTAssertEqualObjects([self->_configInstances[i] defaultValueForKey:key1].stringValue,
-                            @"default key1");
-      XCTAssertEqualObjects(self->_configInstances[i][key2].stringValue, value2);
-      XCTAssertEqualObjects(self->_configInstances[i][key0].stringValue, @"value0-0");
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-      XCTAssertNil([self->_configInstances[i] defaultValueForKey:nil namespace:nil]);
-#pragma clang diagnostic pop
-      OCMVerify([self->_configInstances[i] objectForKeyedSubscript:key1]);
-      XCTAssertEqual(status, FIRRemoteConfigFetchStatusSuccess,
-                     @"Callback of first successful config "
-                     @"fetch. Status must equal to FIRRemoteConfigFetchStatusSuccess.");
-      [fetchConfigsExpectation[i] fulfill];
+      [self->_configInstances[i] activateWithCompletion:^(BOOL changed, NSError *_Nullable error) {
+        XCTAssertTrue(changed);
+        XCTAssertEqualObjects(self->_configInstances[i][key1].stringValue, value1);
+        XCTAssertEqual(self->_configInstances[i][key1].source, FIRRemoteConfigSourceRemote);
+        XCTAssertEqualObjects([self->_configInstances[i] defaultValueForKey:key1].stringValue,
+                              @"default key1");
+        XCTAssertEqualObjects(self->_configInstances[i][key2].stringValue, value2);
+        XCTAssertEqualObjects(self->_configInstances[i][key0].stringValue, @"value0-0");
+        XCTAssertNil([self->_configInstances[i] defaultValueForKey:nil]);
+        OCMVerify([self->_configInstances[i] objectForKeyedSubscript:key1]);
+        XCTAssertEqual(status, FIRRemoteConfigFetchStatusSuccess,
+                       @"Callback of first successful config "
+                       @"fetch. Status must equal to FIRRemoteConfigFetchStatusSuccess.");
+        [fetchConfigsExpectation[i] fulfill];
+      }];
     };
     [_configInstances[i] fetchWithExpirationDuration:43200 completionHandler:fetchCompletion];
   }
@@ -953,7 +948,7 @@ typedef NS_ENUM(NSInteger, RCNTestRCInstance) {
     [_configInstances[i] setDefaults:defaults];
     if (i == RCNTestRCInstanceSecondNamespace) {
       [defaults setObject:@"2860" forKey:@"experience"];
-      [_configInstances[i] setDefaults:defaults namespace:RCNTestsPerfNamespace];
+      [_configInstances[i] setDefaults:defaults];
     }
     // Remove objects right away to make sure dispatch_async gets the copy.
     [defaults removeAllObjects];
@@ -976,9 +971,8 @@ typedef NS_ENUM(NSInteger, RCNTestRCInstance) {
 
     if (i == RCNTestRCInstanceSecondNamespace) {
       XCTAssertEqualObjects(
-          [_configInstances[i] configValueForKey:@"experience" namespace:RCNTestsPerfNamespace]
-              .stringValue,
-          @"2860", @"Only default config has the key, must equal to default config value.");
+          [_configInstances[i] configValueForKey:@"experience"].stringValue, @"2860",
+          @"Only default config has the key, must equal to default config value.");
     }
 
     // Reset default sets
@@ -996,16 +990,13 @@ typedef NS_ENUM(NSInteger, RCNTestRCInstance) {
             [NSString stringWithFormat:@"Set defaults no callback expectation - instance %d", i]];
     // Should work when passing nil.
     [_configInstances[i] setDefaults:nil];
-    [_configInstances[i] setDefaults:nil namespace:nil];
+    [_configInstances[i] setDefaults:nil];
 
     dispatch_after(
         dispatch_time(DISPATCH_TIME_NOW, (int64_t)(_checkCompletionTimeout * NSEC_PER_SEC)),
         dispatch_get_main_queue(), ^{
           XCTAssertEqual(
-              [self->_configInstances[i] allKeysFromSource:FIRRemoteConfigSourceDefault
-                                                 namespace:FIRNamespaceGoogleMobilePlatform]
-                  .count,
-              0);
+              [self->_configInstances[i] allKeysFromSource:FIRRemoteConfigSourceDefault].count, 0);
           [expectations[i] fulfill];
         });
   }
@@ -1035,17 +1026,20 @@ typedef NS_ENUM(NSInteger, RCNTestRCInstance) {
                                                            NSError *error) {
       XCTAssertEqual(self->_configInstances[i].lastFetchStatus, FIRRemoteConfigFetchStatusSuccess);
       XCTAssertNil(error);
-      XCTAssertTrue([self->_configInstances[i] activateFetched]);
-      XCTAssertEqualObjects(self->_configInstances[i][key1].stringValue, value1);
-      XCTAssertEqual(self->_configInstances[i][key1].source, FIRRemoteConfigSourceRemote);
-      XCTAssertEqualObjects([self->_configInstances[i] defaultValueForKey:key1].stringValue,
-                            @"default key1");
-      OCMVerify([self->_configInstances[i] objectForKeyedSubscript:key1]);
 
-      XCTAssertEqual(status, FIRRemoteConfigFetchStatusSuccess,
-                     @"Callback of first successful config "
-                     @"fetch. Status must equal to FIRRemoteConfigFetchStatusSuccess.");
-      [fetchConfigsExpectation[i] fulfill];
+      [self->_configInstances[i] activateWithCompletion:^(BOOL changed, NSError *_Nullable error) {
+        XCTAssertTrue(changed);
+        XCTAssertEqualObjects(self->_configInstances[i][key1].stringValue, value1);
+        XCTAssertEqual(self->_configInstances[i][key1].source, FIRRemoteConfigSourceRemote);
+        XCTAssertEqualObjects([self->_configInstances[i] defaultValueForKey:key1].stringValue,
+                              @"default key1");
+        OCMVerify([self->_configInstances[i] objectForKeyedSubscript:key1]);
+
+        XCTAssertEqual(status, FIRRemoteConfigFetchStatusSuccess,
+                       @"Callback of first successful config "
+                       @"fetch. Status must equal to FIRRemoteConfigFetchStatusSuccess.");
+        [fetchConfigsExpectation[i] fulfill];
+      }];
     };
 
     [_configInstances[i] fetchWithExpirationDuration:43200 completionHandler:fetchCompletion];
@@ -1075,40 +1069,39 @@ typedef NS_ENUM(NSInteger, RCNTestRCInstance) {
       XCTAssertNil(error);
       XCTAssertEqualObjects(self->_configInstances[i][key1].stringValue, @"default value1");
       XCTAssertEqual(self->_configInstances[i][key1].source, FIRRemoteConfigSourceDefault);
-      XCTAssertTrue([self->_configInstances[i] activateFetched]);
-      XCTAssertEqualObjects(self->_configInstances[i][key1].stringValue, value1);
-      XCTAssertEqual(self->_configInstances[i][key1].source, FIRRemoteConfigSourceRemote);
-      FIRRemoteConfigValue *value;
-      if (i == RCNTestRCInstanceDefault) {
-        value = [self->_configInstances[i] configValueForKey:key1
-                                                   namespace:FIRNamespaceGoogleMobilePlatform
-                                                      source:FIRRemoteConfigSourceRemote];
-        XCTAssertEqualObjects(value.stringValue, value1);
-        value = [self->_configInstances[i] configValueForKey:key1
-                                                   namespace:FIRNamespaceGoogleMobilePlatform
-                                                      source:FIRRemoteConfigSourceDefault];
-        XCTAssertEqualObjects(value.stringValue, @"default value1");
-        value = [self->_configInstances[i] configValueForKey:key1
-                                                   namespace:FIRNamespaceGoogleMobilePlatform
-                                                      source:FIRRemoteConfigSourceStatic];
-      } else {
-        value = [self->_configInstances[i] configValueForKey:key1
-                                                      source:FIRRemoteConfigSourceRemote];
-        XCTAssertEqualObjects(value.stringValue, value1);
-        value = [self->_configInstances[i] configValueForKey:key1
-                                                      source:FIRRemoteConfigSourceDefault];
-        XCTAssertEqualObjects(value.stringValue, @"default value1");
-        value = [self->_configInstances[i] configValueForKey:key1
-                                                      source:FIRRemoteConfigSourceStatic];
-      }
-      XCTAssertEqualObjects(value.stringValue, @"");
-      XCTAssertEqualObjects(value.numberValue, @(0));
-      XCTAssertEqual(value.boolValue, NO);
-
-      XCTAssertEqual(status, FIRRemoteConfigFetchStatusSuccess,
-                     @"Callback of first successful config "
-                     @"fetch. Status must equal to FIRRemoteConfigFetchStatusSuccess.");
-      [fetchConfigsExpectation[i] fulfill];
+      [self->_configInstances[i] activateWithCompletion:^(BOOL changed, NSError *_Nullable error) {
+        XCTAssertTrue(changed);
+        XCTAssertEqualObjects(self->_configInstances[i][key1].stringValue, value1);
+        XCTAssertEqual(self->_configInstances[i][key1].source, FIRRemoteConfigSourceRemote);
+        FIRRemoteConfigValue *value;
+        if (i == RCNTestRCInstanceDefault) {
+          value = [self->_configInstances[i] configValueForKey:key1
+                                                        source:FIRRemoteConfigSourceRemote];
+          XCTAssertEqualObjects(value.stringValue, value1);
+          value = [self->_configInstances[i] configValueForKey:key1
+                                                        source:FIRRemoteConfigSourceDefault];
+          XCTAssertEqualObjects(value.stringValue, @"default value1");
+          value = [self->_configInstances[i] configValueForKey:key1
+                                                        source:FIRRemoteConfigSourceStatic];
+        } else {
+          value = [self->_configInstances[i] configValueForKey:key1
+                                                        source:FIRRemoteConfigSourceRemote];
+          XCTAssertEqualObjects(value.stringValue, value1);
+          value = [self->_configInstances[i] configValueForKey:key1
+                                                        source:FIRRemoteConfigSourceDefault];
+          XCTAssertEqualObjects(value.stringValue, @"default value1");
+          value = [self->_configInstances[i] configValueForKey:key1
+                                                        source:FIRRemoteConfigSourceStatic];
+        }
+        XCTAssertEqualObjects(value.stringValue, @"");
+        XCTAssertEqualObjects(value.numberValue, @(0));
+        XCTAssertEqual(value.boolValue, NO);
+
+        XCTAssertEqual(status, FIRRemoteConfigFetchStatusSuccess,
+                       @"Callback of first successful config "
+                       @"fetch. Status must equal to FIRRemoteConfigFetchStatusSuccess.");
+        [fetchConfigsExpectation[i] fulfill];
+      }];
     };
     [_configInstances[i] fetchWithExpirationDuration:43200 completionHandler:fetchCompletion];
   }
@@ -1121,11 +1114,11 @@ typedef NS_ENUM(NSInteger, RCNTestRCInstance) {
     XCTAssertNotNil(value);
     XCTAssertEqual(value.source, FIRRemoteConfigSourceStatic);
 
-    value = [_configInstances[i] configValueForKey:nil namespace:nil];
+    value = [_configInstances[i] configValueForKey:nil];
     XCTAssertNotNil(value);
     XCTAssertEqual(value.source, FIRRemoteConfigSourceStatic);
 
-    value = [_configInstances[i] configValueForKey:nil namespace:nil source:5];
+    value = [_configInstances[i] configValueForKey:nil source:5];
     XCTAssertNotNil(value);
     XCTAssertEqual(value.source, FIRRemoteConfigSourceStatic);
   }
@@ -1195,75 +1188,13 @@ static NSString *UTCToLocal(NSString *utcTime) {
                           UTCToLocal(@"2016-02-28 18:33:31"));
     [_configInstances[i] setDefaultsFromPlistFileName:@"non-existed_file"];
     XCTAssertEqualObjects(_configInstances[i][@"dataValue"].stringValue, @"2.4");
-    [_configInstances[i] setDefaultsFromPlistFileName:nil namespace:nil];
+    [_configInstances[i] setDefaultsFromPlistFileName:nil];
     XCTAssertEqualObjects(_configInstances[i][@"New item"].numberValue, @(2.4));
-    [_configInstances[i] setDefaultsFromPlistFileName:@"" namespace:@""];
+    [_configInstances[i] setDefaultsFromPlistFileName:@""];
     XCTAssertEqualObjects(_configInstances[i][@"Languages"].stringValue, @"English");
   }
 }
 
-- (void)testSetDefaultsAndNamespaceFromPlist {
-  for (int i = 0; i < RCNTestRCNumTotalInstances; i++) {
-    if (i == RCNTestRCInstanceDefault) {
-      [self setDefaultsFor:_configInstances[i] namespace:RCNTestsPerfNamespace];
-      XCTAssertEqualObjects([_configInstances[i] configValueForKey:@"lastCheckTime"
-                                                         namespace:RCNTestsPerfNamespace]
-                                .stringValue,
-                            UTCToLocal(@"2016-02-28 18:33:31"));
-      XCTAssertEqual([_configInstances[i] configValueForKey:@"isPaidUser"
-                                                  namespace:RCNTestsPerfNamespace]
-                         .boolValue,
-                     YES);
-      XCTAssertEqualObjects([_configInstances[i] configValueForKey:@"dataValue"
-                                                         namespace:RCNTestsPerfNamespace]
-                                .stringValue,
-                            @"2.4");
-      XCTAssertEqualObjects([_configInstances[i] configValueForKey:@"New item"
-                                                         namespace:RCNTestsPerfNamespace]
-                                .numberValue,
-                            @(2.4));
-      XCTAssertEqualObjects([_configInstances[i] configValueForKey:@"Languages"
-                                                         namespace:RCNTestsPerfNamespace]
-                                .stringValue,
-                            @"English");
-      XCTAssertEqualObjects([_configInstances[i] configValueForKey:@"FileInfo"
-                                                         namespace:RCNTestsPerfNamespace]
-                                .stringValue,
-                            @"To setup default config.");
-      XCTAssertEqualObjects([_configInstances[i] configValueForKey:@"format"
-                                                         namespace:RCNTestsPerfNamespace]
-                                .stringValue,
-                            @"key to value.");
-    } else {
-      [_configInstances[i] setDefaultsFromPlistFileName:@"Defaults-testInfo"];
-      XCTAssertEqualObjects([_configInstances[i] configValueForKey:@"lastCheckTime"].stringValue,
-                            UTCToLocal(@"2016-02-28 18:33:31"));
-      XCTAssertEqual([_configInstances[i] configValueForKey:@"isPaidUser"].boolValue, YES);
-      XCTAssertEqualObjects([_configInstances[i] configValueForKey:@"dataValue"].stringValue,
-                            @"2.4");
-      XCTAssertEqualObjects([_configInstances[i] configValueForKey:@"New item"].numberValue,
-                            @(2.4));
-      XCTAssertEqualObjects([_configInstances[i] configValueForKey:@"Languages"].stringValue,
-                            @"English");
-      XCTAssertEqualObjects([_configInstances[i] configValueForKey:@"FileInfo"].stringValue,
-                            @"To setup default config.");
-      XCTAssertEqualObjects([_configInstances[i] configValueForKey:@"format"].stringValue,
-                            @"key to value.");
-    }
-  }
-}
-
-- (void)testSetDeveloperMode {
-  for (int i = 0; i < RCNTestRCNumTotalInstances; i++) {
-    XCTAssertFalse(_configInstances[i].configSettings.isDeveloperModeEnabled);
-    FIRRemoteConfigSettings *settings =
-        [[FIRRemoteConfigSettings alloc] initWithDeveloperModeEnabled:YES];
-
-    _configInstances[i].configSettings = settings;
-    XCTAssertTrue(_configInstances[i].configSettings.isDeveloperModeEnabled);
-  }
-}
-
 - (void)testAllKeysFromSource {
   NSMutableArray<XCTestExpectation *> *fetchConfigsExpectation =
       [[NSMutableArray alloc] initWithCapacity:RCNTestRCNumTotalInstances];
@@ -1280,53 +1211,17 @@ static NSString *UTCToLocal(NSString *utcTime) {
                                                            NSError *error) {
       XCTAssertEqual(status, FIRRemoteConfigFetchStatusSuccess);
       XCTAssertNil(error);
-      XCTAssertTrue([self->_configInstances[i] activateFetched]);
-
-      if (i == RCNTestRCInstanceDefault) {
-        XCTAssertEqual(
-            [self->_configInstances[i] allKeysFromSource:FIRRemoteConfigSourceRemote
-                                               namespace:FIRNamespaceGoogleMobilePlatform]
-                .count,
-            100);
-        XCTAssertEqual(
-            [self->_configInstances[i] allKeysFromSource:FIRRemoteConfigSourceDefault
-                                               namespace:FIRNamespaceGoogleMobilePlatform]
-                .count,
-            2);
-        XCTAssertEqual(
-            [self->_configInstances[i] allKeysFromSource:FIRRemoteConfigSourceStatic
-                                               namespace:FIRNamespaceGoogleMobilePlatform]
-                .count,
-            0);
-      } else {
+      [self->_configInstances[i] activateWithCompletion:^(BOOL changed, NSError *_Nullable error) {
+        XCTAssertTrue(changed);
         XCTAssertEqual(
             [self->_configInstances[i] allKeysFromSource:FIRRemoteConfigSourceRemote].count, 100);
         XCTAssertEqual(
             [self->_configInstances[i] allKeysFromSource:FIRRemoteConfigSourceDefault].count, 2);
         XCTAssertEqual(
             [self->_configInstances[i] allKeysFromSource:FIRRemoteConfigSourceStatic].count, 0);
-      }
-
-      XCTAssertNotNil([self->_configInstances[i] allKeysFromSource:FIRRemoteConfigSourceRemote
-                                                         namespace:@"invalid namespace"]);
-      XCTAssertEqual([self->_configInstances[i] allKeysFromSource:FIRRemoteConfigSourceRemote
-                                                        namespace:@"invalid namespace"]
-                         .count,
-                     0);
-      XCTAssertNotNil([self->_configInstances[i] allKeysFromSource:FIRRemoteConfigSourceRemote
-                                                         namespace:nil]);
-      XCTAssertEqual([self->_configInstances[i] allKeysFromSource:FIRRemoteConfigSourceRemote
-                                                        namespace:nil]
-                         .count,
-                     0);
-      XCTAssertNotNil([self->_configInstances[i] allKeysFromSource:FIRRemoteConfigSourceDefault
-                                                         namespace:nil]);
-      XCTAssertEqual([self->_configInstances[i] allKeysFromSource:FIRRemoteConfigSourceDefault
-                                                        namespace:nil]
-                         .count,
-                     0);
-
-      [fetchConfigsExpectation[i] fulfill];
+
+        [fetchConfigsExpectation[i] fulfill];
+      }];
     };
     [_configInstances[i] fetchWithExpirationDuration:43200 completionHandler:fetchCompletion];
   }
@@ -1348,38 +1243,18 @@ static NSString *UTCToLocal(NSString *utcTime) {
       XCTAssertEqual(status, FIRRemoteConfigFetchStatusSuccess);
       XCTAssertNil(error);
       NSLog(@"Testing _configInstances %d", i);
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-      XCTAssertTrue([self->_configInstances[i] activateFetched]);
-
-      // Test keysWithPrefix:namespace: method.
-      if (i == RCNTestRCInstanceDefault) {
-        XCTAssertEqual([self->_configInstances[i] keysWithPrefix:@"key"
-                                                       namespace:FIRNamespaceGoogleMobilePlatform]
-                           .count,
-                       100);
-      } else {
+      [self->_configInstances[i] activateWithCompletion:^(BOOL changed, NSError *_Nullable error) {
+        XCTAssertTrue(changed);
+        // Test keysWithPrefix: method.
+        XCTAssertEqual([self->_configInstances[i] keysWithPrefix:@"key1"].count, 12);
         XCTAssertEqual([self->_configInstances[i] keysWithPrefix:@"key"].count, 100);
-      }
-
-      XCTAssertEqual(
-          [self->_configInstances[i] keysWithPrefix:@"pl" namespace:@"invalid namespace"].count, 0);
-      XCTAssertEqual([self->_configInstances[i] keysWithPrefix:@"pl" namespace:nil].count, 0);
-      XCTAssertEqual([self->_configInstances[i] keysWithPrefix:@"pl" namespace:@""].count, 0);
-
-      XCTAssertNotNil([self->_configInstances[i] keysWithPrefix:nil namespace:nil]);
-      XCTAssertEqual([self->_configInstances[i] keysWithPrefix:nil namespace:nil].count, 0);
-#pragma clang diagnostic pop
 
-      // Test keysWithPrefix: method.
-      XCTAssertEqual([self->_configInstances[i] keysWithPrefix:@"key1"].count, 12);
-      XCTAssertEqual([self->_configInstances[i] keysWithPrefix:@"key"].count, 100);
+        XCTAssertEqual([self->_configInstances[i] keysWithPrefix:@"invalid key"].count, 0);
+        XCTAssertEqual([self->_configInstances[i] keysWithPrefix:nil].count, 100);
+        XCTAssertEqual([self->_configInstances[i] keysWithPrefix:@""].count, 100);
 
-      XCTAssertEqual([self->_configInstances[i] keysWithPrefix:@"invalid key"].count, 0);
-      XCTAssertEqual([self->_configInstances[i] keysWithPrefix:nil].count, 100);
-      XCTAssertEqual([self->_configInstances[i] keysWithPrefix:@""].count, 100);
-
-      [fetchConfigsExpectation[i] fulfill];
+        [fetchConfigsExpectation[i] fulfill];
+      }];
     };
     [_configInstances[i] fetchWithExpirationDuration:43200 completionHandler:fetchCompletion];
   }
@@ -1389,22 +1264,6 @@ static NSString *UTCToLocal(NSString *utcTime) {
                                }];
 }
 
-- (void)testSetDeveloperModeConfigSetting {
-  for (int i = 0; i < RCNTestRCNumTotalInstances; i++) {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    FIRRemoteConfigSettings *settings =
-        [[FIRRemoteConfigSettings alloc] initWithDeveloperModeEnabled:YES];
-    [_configInstances[i] setConfigSettings:settings];
-    XCTAssertTrue([_configInstances[i] configSettings].isDeveloperModeEnabled);
-
-    settings = [[FIRRemoteConfigSettings alloc] initWithDeveloperModeEnabled:NO];
-    [_configInstances[i] setConfigSettings:settings];
-    XCTAssertFalse([_configInstances[i] configSettings].isDeveloperModeEnabled);
-#pragma clang diagnostic pop
-  }
-}
-
 /// Test the minimum fetch interval is applied and read back correctly.
 - (void)testSetMinimumFetchIntervalConfigSetting {
   NSMutableArray<XCTestExpectation *> *fetchConfigsExpectation =