shareFileToMessenger method
Share local file (video or image) to Messenger method.
The method required a local video file path (filePath
),
a custom file provider path (fileProviderPath
) (use on Android platform) and a fileType
that you want to share.
Besides, you can provide the dstPath
(use on Android platform) to add a custom save folder path to cache the local file.
Only AssetType.video and AssetType.image are supported.
iOS properties: pageId
, peopleIds
, hashtag
, etc.
Working on: Android and iOS platforms.
Implementation
Future<dynamic> shareFileToMessenger({
required String? filePath,
required String fileProviderPath,
required AssetType fileType,
String? dstPath,
String? pageId,
String? ref,
List<String>? peopleIds,
String? placeId,
String? hashtag,
String? contentUrl,
String? previewImagePath,
}) async {
assert(
fileType == AssetType.video || fileType == AssetType.image,
"Only video and image types are supported",
);
return _channel.invokeMethod(
'shareFileMessenger',
{
'fileType': fileType.name,
'filePath': filePath,
'fileProviderPath': fileProviderPath,
'dstPath': dstPath,
'pageId': pageId,
'ref': ref,
'peopleIds': peopleIds,
'placeId': placeId,
'hashtag': hashtag,
'contentUrl': contentUrl,
'previewImagePath': previewImagePath,
},
);
}