RCNConfigConstants.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Copyright 2019 Google
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import <Foundation/Foundation.h>
  17. #define RCN_SEC_PER_MIN 60
  18. #define RCN_MSEC_PER_SEC 1000
  19. /// Key prefix applied to all the packages (bundle IDs) in internal metadata.
  20. static NSString *const RCNInternalMetadataAllPackagesPrefix = @"all_packages";
  21. /// HTTP connection default timeout in seconds.
  22. static const NSTimeInterval RCNHTTPDefaultConnectionTimeout = 60;
  23. /// Default duration of how long config data lasts to stay fresh.
  24. static const NSTimeInterval RCNDefaultMinimumFetchInterval = 43200;
  25. /// Label for serial queue for read/write lock on ivars.
  26. static const char *RCNRemoteConfigQueueLabel = "com.google.GoogleConfigService.FIRRemoteConfig";
  27. /// Constants for key names in the fetch response.
  28. /// Key that includes an array of template entries.
  29. static NSString *const RCNFetchResponseKeyEntries = @"entries";
  30. /// Key that includes data for experiment descriptions in ABT.
  31. static NSString *const RCNFetchResponseKeyExperimentDescriptions = @"experimentDescriptions";
  32. /// Key that includes data for Personalization metadata.
  33. static NSString *const RCNFetchResponseKeyPersonalizationMetadata = @"personalizationMetadata";
  34. /// Error key.
  35. static NSString *const RCNFetchResponseKeyError = @"error";
  36. /// Error code.
  37. static NSString *const RCNFetchResponseKeyErrorCode = @"code";
  38. /// Error status.
  39. static NSString *const RCNFetchResponseKeyErrorStatus = @"status";
  40. /// Error message.
  41. static NSString *const RCNFetchResponseKeyErrorMessage = @"message";
  42. /// The current state of the backend template.
  43. static NSString *const RCNFetchResponseKeyState = @"state";
  44. /// Default state (when not set).
  45. static NSString *const RCNFetchResponseKeyStateUnspecified = @"INSTANCE_STATE_UNSPECIFIED";
  46. /// Config key/value map and/or ABT experiment list differs from last fetch.
  47. /// TODO: Migrate to the new HTTP error codes once available in the backend. b/117182055
  48. static NSString *const RCNFetchResponseKeyStateUpdate = @"UPDATE";
  49. /// No template fetched.
  50. static NSString *const RCNFetchResponseKeyStateNoTemplate = @"NO_TEMPLATE";
  51. /// Config key/value map and ABT experiment list both match last fetch.
  52. static NSString *const RCNFetchResponseKeyStateNoChange = @"NO_CHANGE";
  53. /// Template found, but evaluates to empty (e.g. all keys omitted).
  54. static NSString *const RCNFetchResponseKeyStateEmptyConfig = @"EMPTY_CONFIG";
  55. /// Template Version key
  56. static NSString *const RCNFetchResponseKeyTemplateVersion = @"templateVersion";