FirebaseCore Framework Reference

FirebaseOptions

classFirebaseOptions:NSObject,NSCopying

This class provides constant fields of Google APIs.

  • Returns the default options. The first time this is called it synchronously readsGoogleService-Info.plist from disk.

    Declaration

    Swift

    classfuncdefaultOptions()->FirebaseOptions?
  • An API key used for authenticating requests from your Apple app, e.g.The key must begin with “A” and contain exactly 39 alphanumeric characters, used to identify yourapp to Google servers.

    Declaration

    Swift

    varapiKey:String?{getset}
  • The bundle ID for the application. Defaults toBundle.main.bundleIdentifier when not setmanually or in a plist.

    Declaration

    Swift

    varbundleID:String{getset}
  • The OAuth2 client ID for Apple applications used to authenticate Google users, for example@“12345.apps.googleusercontent.com”, used for signing in with Google.

    Declaration

    Swift

    varclientID:String?{getset}
  • The Project Number from the Google Developer’s console, for example @“012345678901”, used toconfigure Firebase Cloud Messaging.

    Declaration

    Swift

    vargcmSenderID:String{getset}
  • The Project ID from the Firebase console, for example @“abc-xyz-123”.

    Declaration

    Swift

    varprojectID:String?{getset}
  • The Google App ID that is used to uniquely identify an instance of an app.

    Declaration

    Swift

    vargoogleAppID:String{getset}
  • The database root URL, e.g. @“http://abc-xyz-123.firebaseio.com”.

    Declaration

    Swift

    vardatabaseURL:String?{getset}
  • The Google Cloud Storage bucket name, e.g. @“abc-xyz-123.storage.firebase.com”.

    Declaration

    Swift

    varstorageBucket:String?{getset}
  • The App Group identifier to share data between the application and the application extensions.The App Group must be configured in the application and on the Apple Developer Portal. Defaultvaluenil.

    Declaration

    Swift

    varappGroupID:String?{getset}
  • Initializes a customized instance of FirebaseOptions from the file at the given plist file path.This will read the file synchronously from disk.For example:

    ifletpath=Bundle.main.path(forResource:"GoogleService-Info",ofType:"plist"){letoptions=FirebaseOptions(contentsOfFile:path)}

    Note that it is not possible to customizeFirebaseOptions for Firebase Analytics which expectsa static file namedGoogleService-Info.plist -https://github.com/firebase/firebase-ios-sdk/issues/230.Returnsnil if the plist file does not exist or is invalid.

    Declaration

    Swift

    init?(contentsOfFileplistPath:String)
  • Initializes a customized instance ofFirebaseOptions with required fields. Use the mutableproperties to modify fields for configuring specific services. Note that it is not possible tocustomizeFirebaseOptions for Firebase Analytics which expects a static file namedGoogleServices-Info.plist -https://github.com/firebase/firebase-ios-sdk/issues/230.

    Declaration

    Swift

    init(googleAppID:String,gcmSenderIDGCMSenderID:String)
  • Unavailable

    Unavailable. Please useinit(contentsOfFile:) orinit(googleAppID:gcmSenderID:) instead.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-07-15 UTC.