Skip to main content
Function Signature
Future<void> configureFirebaseStorage({
  required Future<String?> Function() getToken,
})
Parameters
  • getToken (required): An async callback function that returns a fresh Firebase ID token (String?). This is called before each request to the secure enclave. Return null if no user is signed in.
Returns
  • Future<void> — Completes when Firebase storage is configured.
Throws
  • PlatformException — If there is an error configuring Firebase storage on the native platform.
Example Usage
import 'package:firebase_auth/firebase_auth.dart';
import 'package:portal_flutter/portal_flutter.dart';

final portal = Portal();

await portal.configureFirebaseStorage(
  getToken: () async {
    final user = FirebaseAuth.instance.currentUser;
    if (user == null) return null;
    return await user.getIdToken(true);
  },
);
You must call configureFirebaseStorage() before using PortalBackupMethod.firebase with backupWallet() or recoverWallet(). The user must be signed in to Firebase before performing backup or recovery operations.