shareFileToTelegram method
Share local file to Telegram platform.
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 a dstPath
(use on Android platform) to add a custom save folder path to cache the local file.
NOTE: Because there is noway to send a file directly to Telegram on iOS so the method will call the
UIActivityViewController
class on iOS instead and user have to choose Telegram app to share the file.
Working on: Android and iOS platforms.
Implementation
Future<dynamic> shareFileToTelegram({
required String? filePath,
required String fileProviderPath,
required AssetType fileType,
String? dstPath,
String? message,
}) async {
return _channel.invokeMethod(
'shareFileTelegram',
<String, dynamic>{
'filePath': filePath,
'fileProviderPath': fileProviderPath,
'dstPath': dstPath,
'fileType': fileType.name,
'message': message,
},
);
}