shareMediaContentFileToFacebook method

Future shareMediaContentFileToFacebook({
  1. required String fileProviderPath,
  2. List<String?>? videoUrls,
  3. List<String?>? imageUrls,
  4. String? dstPath,
  5. String? pageId,
  6. String? ref,
  7. List<String>? peopleIds,
  8. String? placeId,
  9. String? hashtag,
  10. String? contentUrl,
})

Share local images and videos to Facebook method. The method required the local video (videoUrls) and image (imageUrls) file paths and your custom file provider path fileProviderPath (use on Android platform) to access the local file.

Besides, you can provide a dstPath (Android platform) to add the custom save folder path to cache the local file, and there are some other properties pageId, peopleIds, hashtag, etc.

Working on: Android and iOS platforms.

Implementation

Future<dynamic> shareMediaContentFileToFacebook({
  required String fileProviderPath,
  List<String?>? videoUrls,
  List<String?>? imageUrls,
  String? dstPath,
  String? pageId,
  String? ref,
  List<String>? peopleIds,
  String? placeId,
  String? hashtag,
  String? contentUrl,
}) async {
  assert(
    imageUrls != null || videoUrls != null,
    "Please provide at least one video list or one image list",
  );

  return _channel.invokeMethod(
    'shareMediaContentFileFacebook',
    <String, dynamic>{
      'dstPath': dstPath,
      'fileProviderPath': fileProviderPath,
      'pageId': pageId,
      'ref': ref,
      'peopleIds': peopleIds,
      'placeId': placeId,
      'hashtag': hashtag,
      'contentUrl': contentUrl,
      'imageUrls': imageUrls,
      'videoUrls': videoUrls,
    },
  );
}