RCNConfigConstants.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. /// Key that includes data for Rollout metadata.
  35. static NSString *const RCNFetchResponseKeyRolloutMetadata = @"rolloutMetadata";
  36. /// Key that indicates rollout id in Rollout metadata.
  37. static NSString *const RCNFetchResponseKeyRolloutID = @"rolloutId";
  38. /// Key that indicates variant id in Rollout metadata.
  39. static NSString *const RCNFetchResponseKeyVariantID = @"variantId";
  40. /// Key that indicates affected parameter keys in Rollout Metadata.
  41. static NSString *const RCNFetchResponseKeyAffectedParameterKeys = @"affectedParameterKeys";
  42. /// Error key.
  43. static NSString *const RCNFetchResponseKeyError = @"error";
  44. /// Error code.
  45. static NSString *const RCNFetchResponseKeyErrorCode = @"code";
  46. /// Error status.
  47. static NSString *const RCNFetchResponseKeyErrorStatus = @"status";
  48. /// Error message.
  49. static NSString *const RCNFetchResponseKeyErrorMessage = @"message";
  50. /// The current state of the backend template.
  51. static NSString *const RCNFetchResponseKeyState = @"state";
  52. /// Default state (when not set).
  53. static NSString *const RCNFetchResponseKeyStateUnspecified = @"INSTANCE_STATE_UNSPECIFIED";
  54. /// Config key/value map and/or ABT experiment list differs from last fetch.
  55. /// TODO: Migrate to the new HTTP error codes once available in the backend. b/117182055
  56. static NSString *const RCNFetchResponseKeyStateUpdate = @"UPDATE";
  57. /// No template fetched.
  58. static NSString *const RCNFetchResponseKeyStateNoTemplate = @"NO_TEMPLATE";
  59. /// Config key/value map and ABT experiment list both match last fetch.
  60. static NSString *const RCNFetchResponseKeyStateNoChange = @"NO_CHANGE";
  61. /// Template found, but evaluates to empty (e.g. all keys omitted).
  62. static NSString *const RCNFetchResponseKeyStateEmptyConfig = @"EMPTY_CONFIG";
  63. /// Fetched Template Version key
  64. static NSString *const RCNFetchResponseKeyTemplateVersion = @"templateVersion";
  65. /// Active Template Version key
  66. static NSString *const RCNActiveKeyTemplateVersion = @"activeTemplateVersion";