flutter_get_app_group_directory 1.0.0 copy "flutter_get_app_group_directory: ^1.0.0" to clipboard
flutter_get_app_group_directory: ^1.0.0 copied to clipboard

PlatformiOSmacOS

A Flutter plugin for iOS and macOS that resolves the shared container directory for an App Group.

flutter_get_app_group_directory #

A Flutter plugin for iOS and macOS that resolves the shared container directory for an App Group.

Pub Dart CI Star on GitHub License: MIT


Supported Platforms #

Platform Support
iOS
macOS

Prerequisites #

  1. Open your app in Xcode.
  2. In Signing & Capabilities, add the App Groups capability to both your main target and any extension that needs access.
  3. Register the group identifier (e.g. group.com.example.myapp).

The same identifier must be added to both the app and extension entitlements.


Installation #

Add the package to your pubspec.yaml:

dependencies:
  flutter_get_app_group_directory: 

Usage #

import 'dart:io';
import 'package:flutter/services.dart';
import 'package:flutter_get_app_group_directory/flutter_get_app_group_directory.dart';

Future<void> example() async {
  try {
    final Directory dir = await getAppGroupDirectory(
      'group.com.example.myapp',
    );
    print('Shared container path: ${dir.path}');
  } on PlatformException catch (e) {
    // e.code is one of:
    //   'INVALID_ARGUMENTS' – identifier argument was missing or of the wrong type
    //   'APP_GROUP_NOT_FOUND' – the OS could not resolve a container URL for that identifier
    //   'NULL_RESULT' – the native side returned null unexpectedly
    print('Failed to get app group directory: [${e.code}] ${e.message}');
  }
}

API #

getAppGroupDirectory(String identifier) #

Returns the Directory representing the shared container for the App Group identified by identifier.

Parameter Type Description
identifier String The App Group identifier (e.g. group.com.example.myapp)

Returns Future<Directory>

Throws PlatformException with one of the following codes:

Code Description
INVALID_ARGUMENTS The identifier argument is missing or not a String.
APP_GROUP_NOT_FOUND The OS could not resolve a container URL for the identifier.
NULL_RESULT The native layer returned null unexpectedly.

License #

MIT — see LICENSE.

0
likes
150
points
106
downloads

Publisher

verified publishermylittlesuite.com

Weekly Downloads

A Flutter plugin for iOS and macOS that resolves the shared container directory for an App Group.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on flutter_get_app_group_directory

Packages that implement flutter_get_app_group_directory