FIRModelManager


@interface FIRModelManager : NSObject

A Firebase model manager for both local and cloud models.

  • Gets the model manager for the default Firebase app. The default Firebase app instance must be configured before calling this method; otherwise raises FIRAppNotConfigured exception. The returned model manager is thread safe. Models hosted in non-default Firebase apps are currently not supported.

    Declaration

    Objective-C

    + (nonnull instancetype)modelManager;

    Return Value

    A model manager for the default Firebase app.

  • Unavailable. Use the modelManager class method.

    Declaration

    Objective-C

    - (nonnull instancetype)init;
  • Registers a cloud model. The model name is unique to each cloud model and can only be registered once with a given instance of the ModelManager. The model name should be the same name used when uploading the model to the Firebase Console. It’s OK to separately register a cloud model and a local model with the same name for a given instance of the ModelManager.

    Declaration

    Objective-C

    - (BOOL)registerCloudModelSource:
        (nonnull FIRCloudModelSource *)cloudModelSource;

    Parameters

    cloudModelSource

    The cloud model source to register.

    Return Value

    Whether the registration was successful. Returns NO if the given cloudModelSource is invalid or has already been registered.

  • Registers a local model. The model name is unique to each local model and can only be registered once with a given instance of the ModelManager. It’s OK to separately register a cloud model and a local model with the same name for a given instance of the ModelManager.

    Declaration

    Objective-C

    - (BOOL)registerLocalModelSource:
        (nonnull FIRLocalModelSource *)localModelSource;

    Parameters

    localModelSource

    The local model source to register.

    Return Value

    Whether the registration was successful. Returns NO if the given localModelSource is invalid or has already been registered.

  • Gets the registered cloud model with the given name. Returns nil if the model was never registered with this model manager.

    Declaration

    Objective-C

    - (nullable FIRCloudModelSource *)cloudModelSourceForModelName:
        (nonnull NSString *)name;

    Parameters

    name

    Name of the cloud model.

    Return Value

    The cloud model that was registered with the given name. Returns nil if the model was never registered with this model manager.

  • Gets the registered local model with the given name. Returns nil if the model was never registered with this model manager.

    Declaration

    Objective-C

    - (nullable FIRLocalModelSource *)localModelSourceForModelName:
        (nonnull NSString *)name;

    Parameters

    name

    Name of the local model.

    Return Value

    The local model that was registered with the given name. Returns nil if the model was never registered with this model manager.