shareFileToFacebook method
Share local file (video or image) to Facebook method. This method is merged from
shareVideoToFacebook
and sharePhotoToFacebook
methods.
The method required a local video file path (filePath
) and
a custom file provider path (fileProviderPath
=> use on Android platform) to access the local file.
Besides, you can provide a dstPath
(Android platform) to add a custom save folder path to cache the local file,
and there are some other properties pageId
, peopleIds
, hashtag
, etc.
Only AssetType.video and AssetType.image are supported.
Working on: Android and iOS platforms.
Implementation
Future<dynamic> shareFileToFacebook({
required AssetType fileType,
required String? filePath,
required String fileProviderPath,
String? dstPath,
String? pageId,
String? ref,
List<String>? peopleIds,
String? placeId,
String? hashtag,
String? contentUrl,
String? contentTitle,
String? contentDescription,
String? previewImagePath,
}) async {
assert(
fileType == AssetType.video || fileType == AssetType.image,
"Only video and image types are supported",
);
return _channel.invokeMethod(
'shareFileFacebook',
{
'fileType': fileType.name,
'filePath': filePath,
'dstPath': dstPath,
'fileProviderPath': fileProviderPath,
'pageId': pageId,
'ref': ref,
'peopleIds': peopleIds,
'placeId': placeId,
'hashtag': hashtag,
'contentUrl': contentUrl,
'contentTitle': contentTitle,
'contentDescription': contentDescription,
'previewImagePath': previewImagePath,
},
);
}