getInitialMedia static method

Future<List<SharedMediaFile>> getInitialMedia(
  1. String identifer
)

Returns a Future, which completes to one of the following:

  • the initially stored media uri (possibly null), on successful invocation;
  • a PlatformException, if the invocation failed in the platform plugin.

NOTE. The returned media on iOS (iOS ONLY) is already copied to a temp folder. So, you need to delete the file after you finish using it

Implementation

static Future<List<SharedMediaFile>> getInitialMedia(String identifer) async {
  final json = await _mChannel.invokeMethod('getInitialMedia',{"identifier":identifier});
  if (json == null) return [];
  final encoded = jsonDecode(json);
  return encoded
      .map<SharedMediaFile>((file) => SharedMediaFile.fromJson(file))
      .toList();
}