FIROptionsInternal.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /*
  2. * Copyright 2017 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. #if SWIFT_PACKAGE
  17. // TODO(paulb777): Investigate if there's a common strategy for both Cocoapods and Swift PM.
  18. #import "FIROptions.h"
  19. #else
  20. #import <FirebaseCore/FIROptions.h>
  21. #endif
  22. /**
  23. * Keys for the strings in the plist file.
  24. */
  25. extern NSString *const kFIRAPIKey;
  26. extern NSString *const kFIRTrackingID;
  27. extern NSString *const kFIRGoogleAppID;
  28. extern NSString *const kFIRClientID;
  29. extern NSString *const kFIRGCMSenderID;
  30. extern NSString *const kFIRAndroidClientID;
  31. extern NSString *const kFIRDatabaseURL;
  32. extern NSString *const kFIRStorageBucket;
  33. extern NSString *const kFIRBundleID;
  34. extern NSString *const kFIRProjectID;
  35. /**
  36. * Keys for the plist file name
  37. */
  38. extern NSString *const kServiceInfoFileName;
  39. extern NSString *const kServiceInfoFileType;
  40. /**
  41. * This header file exposes the initialization of FIROptions to internal use.
  42. */
  43. @interface FIROptions ()
  44. /**
  45. * resetDefaultOptions and initInternalWithOptionsDictionary: are exposed only for unit tests.
  46. */
  47. + (void)resetDefaultOptions;
  48. /**
  49. * Initializes the options with dictionary. The above strings are the keys of the dictionary.
  50. * This is the designated initializer.
  51. */
  52. - (instancetype)initInternalWithOptionsDictionary:(NSDictionary *)serviceInfoDictionary;
  53. /**
  54. * defaultOptions and defaultOptionsDictionary are exposed in order to be used in FIRApp and
  55. * other first party services.
  56. */
  57. + (FIROptions *)defaultOptions;
  58. + (NSDictionary *)defaultOptionsDictionary;
  59. /**
  60. * Indicates whether or not Analytics collection was explicitly enabled via a plist flag or at
  61. * runtime.
  62. */
  63. @property(nonatomic, readonly) BOOL isAnalyticsCollectionExplicitlySet;
  64. /**
  65. * Whether or not Analytics Collection was enabled. Analytics Collection is enabled unless
  66. * explicitly disabled in GoogleService-Info.plist.
  67. */
  68. @property(nonatomic, readonly) BOOL isAnalyticsCollectionEnabled;
  69. /**
  70. * Whether or not Analytics Collection was completely disabled. If YES, then
  71. * isAnalyticsCollectionEnabled will be NO.
  72. */
  73. @property(nonatomic, readonly) BOOL isAnalyticsCollectionDeactivated;
  74. /**
  75. * The version ID of the client library, e.g. @"1100000".
  76. */
  77. @property(nonatomic, readonly, copy) NSString *libraryVersionID;
  78. /**
  79. * The flag indicating whether this object was constructed with the values in the default plist
  80. * file.
  81. */
  82. @property(nonatomic) BOOL usingOptionsFromDefaultPlist;
  83. /**
  84. * Whether or not Measurement was enabled. Measurement is enabled unless explicitly disabled in
  85. * GoogleService-Info.plist.
  86. */
  87. @property(nonatomic, readonly) BOOL isMeasurementEnabled;
  88. /**
  89. * Whether or not Analytics was enabled in the developer console.
  90. */
  91. @property(nonatomic, readonly) BOOL isAnalyticsEnabled;
  92. /**
  93. * Whether or not SignIn was enabled in the developer console.
  94. */
  95. @property(nonatomic, readonly) BOOL isSignInEnabled;
  96. /**
  97. * Whether or not editing is locked. This should occur after FIROptions has been set on a FIRApp.
  98. */
  99. @property(nonatomic, getter=isEditingLocked) BOOL editingLocked;
  100. @end