FIROptions.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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. #import <Foundation/Foundation.h>
  17. NS_ASSUME_NONNULL_BEGIN
  18. /**
  19. * This class provides constant fields of Google APIs.
  20. */
  21. NS_SWIFT_NAME(FirebaseOptions)
  22. @interface FIROptions : NSObject <NSCopying>
  23. /**
  24. * Returns the default options. The first time this is called it synchronously reads
  25. * GoogleService-Info.plist from disk.
  26. */
  27. + (nullable FIROptions *)defaultOptions NS_SWIFT_NAME(defaultOptions());
  28. /**
  29. * An iOS API key used for authenticating requests from your app, e.g.
  30. * The key must begin with "A" and contain exactly 39 alphanumeric characters, used to identify your
  31. * app to Google servers.
  32. */
  33. @property(nonatomic, copy, nullable) NSString *APIKey NS_SWIFT_NAME(apiKey);
  34. /**
  35. * The bundle ID for the application. Defaults to `Bundle.main.bundleIdentifier` when not set
  36. * manually or in a plist.
  37. */
  38. @property(nonatomic, copy) NSString *bundleID;
  39. /**
  40. * The OAuth2 client ID for iOS application used to authenticate Google users, for example
  41. * @"12345.apps.googleusercontent.com", used for signing in with Google.
  42. */
  43. @property(nonatomic, copy, nullable) NSString *clientID;
  44. /**
  45. * The tracking ID for Google Analytics, e.g. @"UA-12345678-1", used to configure Google Analytics.
  46. */
  47. @property(nonatomic, copy, nullable) NSString *trackingID;
  48. /**
  49. * The Project Number from the Google Developer's console, for example @"012345678901", used to
  50. * configure Google Cloud Messaging.
  51. */
  52. @property(nonatomic, copy) NSString *GCMSenderID NS_SWIFT_NAME(gcmSenderID);
  53. /**
  54. * The Project ID from the Firebase console, for example @"abc-xyz-123".
  55. */
  56. @property(nonatomic, copy, nullable) NSString *projectID;
  57. /**
  58. * The Android client ID used in Google AppInvite when an iOS app has its Android version, for
  59. * example @"12345.apps.googleusercontent.com".
  60. */
  61. @property(nonatomic, copy, nullable) NSString *androidClientID;
  62. /**
  63. * The Google App ID that is used to uniquely identify an instance of an app.
  64. */
  65. @property(nonatomic, copy) NSString *googleAppID;
  66. /**
  67. * The database root URL, e.g. @"http://abc-xyz-123.firebaseio.com".
  68. */
  69. @property(nonatomic, copy, nullable) NSString *databaseURL;
  70. /**
  71. * The URL scheme used to set up Durable Deep Link service.
  72. */
  73. @property(nonatomic, copy, nullable) NSString *deepLinkURLScheme;
  74. /**
  75. * The Google Cloud Storage bucket name, e.g. @"abc-xyz-123.storage.firebase.com".
  76. */
  77. @property(nonatomic, copy, nullable) NSString *storageBucket;
  78. /**
  79. * The App Group identifier to share data between the application and the application extensions.
  80. * The App Group must be configured in the application and on the Apple Developer Portal. Default
  81. * value `nil`.
  82. */
  83. @property(nonatomic, copy, nullable) NSString *appGroupID;
  84. /**
  85. * Initializes a customized instance of FirebaseOptions from the file at the given plist file path.
  86. * This will read the file synchronously from disk.
  87. * For example:
  88. * ```swift
  89. * if let path = Bundle.main.path(forResource:"GoogleServices-Info", ofType:"plist") {
  90. * let options = FirebaseOptions(contentsOfFile: path)
  91. * }
  92. * ```
  93. * Note that it is not possible to customize `FirebaseOptions` for Firebase Analytics which expects
  94. * a static file named `GoogleServices-Info.plist` -
  95. * https://github.com/firebase/firebase-ios-sdk/issues/230.
  96. * Returns `nil` if the plist file does not exist or is invalid.
  97. */
  98. - (nullable instancetype)initWithContentsOfFile:(NSString *)plistPath NS_DESIGNATED_INITIALIZER;
  99. /**
  100. * Initializes a customized instance of `FirebaseOptions` with required fields. Use the mutable
  101. * properties to modify fields for configuring specific services. Note that it is not possible to
  102. * customize `FirebaseOptions` for Firebase Analytics which expects a static file named
  103. * `GoogleServices-Info.plist` - https://github.com/firebase/firebase-ios-sdk/issues/230.
  104. */
  105. - (instancetype)initWithGoogleAppID:(NSString *)googleAppID
  106. GCMSenderID:(NSString *)GCMSenderID
  107. NS_SWIFT_NAME(init(googleAppID:gcmSenderID:))NS_DESIGNATED_INITIALIZER;
  108. /** Unavailable. Please use `init(contentsOfFile:)` or `init(googleAppID:gcmSenderID:)` instead. */
  109. - (instancetype)init NS_UNAVAILABLE;
  110. @end
  111. NS_ASSUME_NONNULL_END