FirebaseStorage handles storing and retrieving backup encryption keys using Firebase Authentication. It communicates with Portal’s secure enclave using Firebase ID tokens for authentication.
Initializer
getToken: A callback that returns a fresh Firebase ID token. This is called before each request to the secure enclave to ensure the token is valid. The callback should call Firebase’sgetIDToken()method internally. Returnnilif no user is signed in.
FirebaseStorage can throw the following errors:
FirebaseStorageError.noApiKey: The client API key has not been set on theFirebaseStorageinstance. This means the storage was not registered viaportal.registerBackupMethod().FirebaseStorageError.tokenUnavailable: ThegetTokencallback returnednil. Ensure the user is signed in to Firebase before performing backup or recovery.FirebaseStorageError.unexpectedResponse(String): The secure enclave returned an unexpected response.FirebaseStorageError.requestFailed(underlying: Error): A non-401 request to the secure enclave failed. The underlying error contains details about the failure.