FIRApp.h 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #import <Foundation/Foundation.h>
  2. #import <UIKit/UIKit.h>
  3. @class FIROptions;
  4. NS_ASSUME_NONNULL_BEGIN
  5. /** A block that takes a BOOL and has no return value. */
  6. typedef void (^FIRAppVoidBoolCallback)(BOOL success);
  7. /**
  8. * The entry point of Firebase SDKs.
  9. *
  10. * Initialize and configure FIRApp using +[FIRApp configure]
  11. * or other customized ways as shown below.
  12. *
  13. * The logging system has two modes: default mode and debug mode. In default mode, only logs with
  14. * log level Notice, Warning and Error will be sent to device. In debug mode, all logs will be sent
  15. * to device. The log levels that Firebase uses are consistent with the ASL log levels.
  16. *
  17. * Enable debug mode by passing the -FIRDebugEnabled argument to the application. You can add this
  18. * argument in the application's Xcode scheme. When debug mode is enabled via -FIRDebugEnabled,
  19. * further executions of the application will also be in debug mode. In order to return to default
  20. * mode, you must explicitly disable the debug mode with the application argument -FIRDebugDisabled.
  21. *
  22. * It is also possible to change the default logging level in code by calling setLoggerLevel: on
  23. * the FIRConfiguration interface.
  24. */
  25. @interface FIRApp : NSObject
  26. /**
  27. * Configures a default Firebase app. Raises an exception if any configuration step fails. The
  28. * default app is named "__FIRAPP_DEFAULT". This method should be called after the app is launched
  29. * and before using Firebase services. This method is thread safe.
  30. */
  31. + (void)configure;
  32. /**
  33. * Configures the default Firebase app with the provided options. The default app is named
  34. * "__FIRAPP_DEFAULT". Raises an exception if any configuration step fails. This method is thread
  35. * safe.
  36. *
  37. * @param options The Firebase application options used to configure the service.
  38. */
  39. + (void)configureWithOptions:(FIROptions *)options;
  40. /**
  41. * Configures a Firebase app with the given name and options. Raises an exception if any
  42. * configuration step fails. This method is thread safe.
  43. *
  44. * @param name The application's name given by the developer. The name should should only contain
  45. Letters, Numbers and Underscore.
  46. * @param options The Firebase application options used to configure the services.
  47. */
  48. + (void)configureWithName:(NSString *)name options:(FIROptions *)options;
  49. /**
  50. * Returns the default app, or nil if the default app does not exist.
  51. */
  52. + (nullable FIRApp *)defaultApp NS_SWIFT_NAME(defaultApp());
  53. /**
  54. * Returns a previously created FIRApp instance with the given name, or nil if no such app exists.
  55. * This method is thread safe.
  56. */
  57. + (nullable FIRApp *)appNamed:(NSString *)name;
  58. /**
  59. * Returns the set of all extant FIRApp instances, or nil if there are no FIRApp instances. This
  60. * method is thread safe.
  61. */
  62. + (nullable NSDictionary *)allApps;
  63. /**
  64. * Cleans up the current FIRApp, freeing associated data and returning its name to the pool for
  65. * future use. This method is thread safe.
  66. */
  67. - (void)deleteApp:(FIRAppVoidBoolCallback)completion;
  68. /**
  69. * FIRApp instances should not be initialized directly. Call +[FIRApp configure],
  70. * +[FIRApp configureWithOptions:], or +[FIRApp configureWithNames:options:] directly.
  71. */
  72. - (instancetype)init NS_UNAVAILABLE;
  73. /**
  74. * Gets the name of this app.
  75. */
  76. @property(nonatomic, copy, readonly) NSString *name;
  77. /**
  78. * Gets the options for this app.
  79. */
  80. @property(nonatomic, readonly) FIROptions *options;
  81. @end
  82. NS_ASSUME_NONNULL_END