FPRFakeRemoteConfig.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. // Copyright 2020 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #import <Foundation/Foundation.h>
  15. #import "FirebaseRemoteConfig/Sources/Private/FIRRemoteConfig_Private.h"
  16. #import "FirebaseRemoteConfig/Sources/RCNConfigValue_Internal.h"
  17. NS_ASSUME_NONNULL_BEGIN
  18. // This is a fake Remote Config class to manipulate the inputs.
  19. @interface FPRFakeRemoteConfig : NSObject
  20. /** @brief Last config fetch time. */
  21. @property(nonatomic, nullable) NSDate *lastFetchTime;
  22. /** @brief Last config fetch status. */
  23. @property(nonatomic) FIRRemoteConfigFetchStatus lastFetchStatus;
  24. /**
  25. * @brief Config status for the upcoming fetch call. This will be used in the response when calling
  26. * fetch.
  27. */
  28. @property(assign) FIRRemoteConfigFetchAndActivateStatus fetchStatus;
  29. /** @brief Different configurations values that needs to be stored and returned. */
  30. @property(nonatomic) NSMutableDictionary<NSString *, FIRRemoteConfigValue *> *configValues;
  31. /**
  32. * Fake fetch call for fetching configs. Calling this method will just call the completionHandler.
  33. *
  34. * @param completionHandler Completion handler to be invoked.
  35. */
  36. - (void)fetchAndActivateWithCompletionHandler:
  37. (nullable FIRRemoteConfigFetchAndActivateCompletion)completionHandler;
  38. /**
  39. * Fake to fetch the config value for a provided key.
  40. *
  41. * @param key Key for which the value is fetched.
  42. * @return Configuration value as specified.
  43. */
  44. - (FIRRemoteConfigValue *)configValueForKey:(NSString *)key;
  45. @end
  46. NS_ASSUME_NONNULL_END