FIROptions

@interface FIROptions : NSObject <NSCopying>

This class provides constant fields of Google APIs.

  • Returns the default options.

    Declaration

    Swift

    class func `default`() -> FIROptions!

    Objective-C

    + (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 }

    Objective-C

    @property (readonly, copy, nonatomic) NSString *APIKey;
  • 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 }

    Objective-C

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

    Declaration

    Swift

    var trackingID: String! { get }

    Objective-C

    @property (readonly, copy, nonatomic) 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 }

    Objective-C

    @property (readonly, copy, nonatomic) NSString *GCMSenderID;
  • 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 }

    Objective-C

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

    Declaration

    Swift

    var googleAppID: String! { get }

    Objective-C

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

    Declaration

    Swift

    var databaseURL: String! { get }

    Objective-C

    @property (readonly, copy, nonatomic) 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) NSString *deepLinkURLScheme;
  • The Google Cloud Storage bucket name, e.g. @abc-xyz-123.storage.firebase.com.

    Declaration

    Swift

    var storageBucket: String! { get }

    Objective-C

    @property (readonly, copy, nonatomic) 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

    - (instancetype)initWithGoogleAppID:(NSString *)googleAppID
                               bundleID:(NSString *)bundleID
                            GCMSenderID:(NSString *)GCMSenderID
                                 APIKey:(NSString *)APIKey
                               clientID:(NSString *)clientID
                             trackingID:(NSString *)trackingID
                        androidClientID:(NSString *)androidClientID
                            databaseURL:(NSString *)databaseURL
                          storageBucket:(NSString *)storageBucket
                      deepLinkURLScheme:(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

    - (instancetype)initWithContentsOfFile:(NSString *)plistPath;