FIRModelManager


@interface FIRModelManager : NSObject

A Firebase model manager for both local and cloud custom models.

  • Gets the custom 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. Custom models hosted in non-default Firebase apps are currently not supported.

    Declaration

    Objective-C

    + (nonnull instancetype)modelManager;

    Return Value

    A custom model manager for the default Firebase app.

  • Unavailable.

    Declaration

    Objective-C

    - (nonnull instancetype)init;
  • Registers a cloud model to be used by the custom model interpreter. The model name is unique to each custom 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 custom 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 is successful. Returns NO if the given cloudModelSource is invalid or it has already been registered.

  • Registers a local model to be used by the custom model interpreter. The model name is unique to each custom 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 is successful. Returns NO if the given localModelSource is invalid or it has already been registered.

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

    Declaration

    Objective-C

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

    Parameters

    modelName

    Name of the cloud model.

    Return Value

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

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

    Declaration

    Objective-C

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

    Parameters

    modelName

    The name of the local model.

    Return Value

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