FIROptions


@interface FIROptions : NSObject <NSCopying>

This class provides constant fields of Google APIs.

  • Returns the default options.

    Declaration

    Swift

    class func defaultOptions() -> FirebaseOptions?

    Objective-C

    + (nullable FIROptions *)defaultOptions;
  • An iOS API key used for authenticating requests from your app, e.g. @AIzaSyDdVgKwhZl0sTTTLZ7iTmt1r3N2cJLnaDk, used to identify your app to Google servers.

    Declaration

    Swift

    var apiKey: String? { get set }

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *APIKey;
  • The bundle ID for the application. Defaults to [[NSBundle mainBundle] bundleID] when not set manually or in a plist.

    Declaration

    Swift

    var bundleID: String { get set }

    Objective-C

    @property (readwrite, copy, nonatomic) NSString *_Nonnull bundleID;
  • The OAuth2 client ID for iOS application used to authenticate Google users, for example @12345.apps.googleusercontent.com, used for signing in with Google.

    Declaration

    Swift

    var clientID: String? { get set }

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *clientID;
  • The tracking ID for Google Analytics, e.g. @UA-12345678-1, used to configure Google Analytics.

    Declaration

    Swift

    var trackingID: String? { get set }

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *trackingID;
  • The Project Number from the Google Developer’s console, for example @012345678901, used to configure Google Cloud Messaging.

    Declaration

    Swift

    var gcmSenderID: String { get set }

    Objective-C

    @property (readwrite, copy, nonatomic) NSString *_Nonnull GCMSenderID;
  • The Project ID from the Firebase console, for example @abc-xyz-123.

    Declaration

    Swift

    var projectID: String? { get set }

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *projectID;
  • The Android client ID used in Google AppInvite when an iOS app has its Android version, for example @12345.apps.googleusercontent.com.

    Declaration

    Swift

    var androidClientID: String? { get set }

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *androidClientID;
  • The Google App ID that is used to uniquely identify an instance of an app.

    Declaration

    Swift

    var googleAppID: String { get set }

    Objective-C

    @property (readwrite, copy, nonatomic) NSString *_Nonnull googleAppID;
  • The database root URL, e.g. @http://abc-xyz-123.firebaseio.com.

    Declaration

    Swift

    var databaseURL: String? { get set }

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *databaseURL;
  • The URL scheme used to set up Durable Deep Link service.

    Declaration

    Swift

    var deepLinkURLScheme: String? { get set }

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *deepLinkURLScheme;
  • The Google Cloud Storage bucket name, e.g. @abc-xyz-123.storage.firebase.com.

    Declaration

    Swift

    var storageBucket: String? { get set }

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *storageBucket;
  • Initializes a customized instance of FIROptions with keys. googleAppID, bundleID and GCMSenderID are required. Other keys may required for configuring specific services.

    Declaration

    Swift

    init(googleAppID: String, bundleID: String, gcmSenderID GCMSenderID: String, apiKey APIKey: String, clientID: String, trackingID: String, androidClientID: String, databaseURL: String, storageBucket: String, deepLinkURLScheme: String)

    Objective-C

    - (nonnull instancetype)initWithGoogleAppID:(nonnull NSString *)googleAppID
                                       bundleID:(nonnull NSString *)bundleID
                                    GCMSenderID:(nonnull NSString *)GCMSenderID
                                         APIKey:(nonnull NSString *)APIKey
                                       clientID:(nonnull NSString *)clientID
                                     trackingID:(nonnull NSString *)trackingID
                                androidClientID:(nonnull NSString *)androidClientID
                                    databaseURL:(nonnull NSString *)databaseURL
                                  storageBucket:(nonnull NSString *)storageBucket
                              deepLinkURLScheme:
                                  (nonnull NSString *)deepLinkURLScheme;
  • Initializes a customized instance of FIROptions from the file at the given plist file path. For example, NSString *filePath = [[NSBundle mainBundle] pathForResource:@GoogleService-Info ofType:@plist]; FIROptions *options = [[FIROptions alloc] initWithContentsOfFile:filePath]; Returns nil if the plist file does not exist or is invalid.

    Declaration

    Swift

    init?(contentsOfFile plistPath: String)

    Objective-C

    - (nullable instancetype)initWithContentsOfFile:(nonnull NSString *)plistPath;
  • Initializes a customized instance of FIROptions with required fields. Use the mutable properties to modify fields for configuring specific services.

    Declaration

    Swift

    init(googleAppID: String, gcmSenderID GCMSenderID: String)

    Objective-C

    - (nonnull instancetype)initWithGoogleAppID:(nonnull NSString *)googleAppID
                                    GCMSenderID:(nonnull NSString *)GCMSenderID;