Instagram sharing now working on my app.
Working fine on all platform.
It is showing "Unable to process video" event thought my sharable content is image.
here is my code.
` static Future shareMedia({String url, String type = 'image'}) async {
File file = File(url);
var newFile = basename(file.path);
var newFileName = basenameWithoutExtension(file.path);
var type = "video/mp4";
if (type == 'image') {
type = 'image/jpg';
}
//
var request = await HttpClient().getUrl(
Uri.parse(url),
);
var response = await request.close();
Uint8List bytes = await consolidateHttpClientResponseBytes(response);
//
await Share.file(
newFileName,
newFile,
bytes,
type,
text: AppConfig.msg + '\n' + AppConfig.appUrl,
);
Instagram sharing now working on my app. Working fine on all platform. It is showing "Unable to process video" event thought my sharable content is image.
here is my code. ` static Future shareMedia({String url, String type = 'image'}) async { File file = File(url);
}`
Am I doing something wrong???