FPRFakeRemoteConfig.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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;
  16. @import FirebaseRemoteConfig;
  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. - (instancetype)init;
  32. /**
  33. * Fake fetch call for fetching configs. Calling this method will just call the completionHandler.
  34. *
  35. * @param completionHandler Completion handler to be invoked.
  36. */
  37. - (void)fetchAndActivateWithCompletionHandler:
  38. (nullable FIRRemoteConfigFetchAndActivateCompletion)completionHandler;
  39. /**
  40. * Fake to fetch the config value for a provided key.
  41. *
  42. * @param key Key for which the value is fetched.
  43. * @return Configuration value as specified.
  44. */
  45. - (FIRRemoteConfigValue *)configValueForKey:(NSString *)key;
  46. @end
  47. NS_ASSUME_NONNULL_END