Skip to main content

Function Signature

Future<void> configureGoogleStorage({
  required String clientId,
  String? applicationName,
})

Description

Configures Google Drive backup storage. This must be called before using Google Drive for backup or recovery operations.

Parameters

ParameterTypeRequiredDescription
clientIdStringYesYour Google OAuth client ID
applicationNameStringNoOptional application name

Returns

void

Example

import 'package:portal_flutter/portal_flutter.dart';

final portal = Portal();

// Configure Google Drive
await portal.configureGoogleStorage(
  clientId: 'your-google-oauth-client-id.apps.googleusercontent.com',
  applicationName: 'My Wallet App',
);

// Now you can use Google Drive backup
final response = await portal.backupWallet(
  method: PortalBackupMethod.googleDrive,
);

Setup Requirements

Android

  1. Create a Google Cloud project
  2. Configure OAuth consent screen
  3. Create an Android OAuth client ID
  4. Add the client ID to your app

iOS

  1. Create a Google Cloud project
  2. Configure OAuth consent screen
  3. Create an iOS OAuth client ID
  4. Add the client ID to your app
  5. Add URL schemes to Info.plist
See the Google Drive backup options guide for detailed setup instructions.

Errors

CodeDescription
NOT_INITIALIZEDPortal was not initialized
CONFIGURATION_FAILEDFailed to configure Google Drive