Closed sakinaboriwala closed 3 years ago
Your file name has .png extension. Try to fix it.
@aarajput Thanks for your quick reply. will change it and get back to you!
works well! Only one thing, unable to share text with audio file. Any fix for that too? @aarajput
So, you are saying that property text isn't working. Right?
Yes. It;s working when I share image and video but not for audio. @aarajput
Try using breakpoint and share your text here incase of audio share.
Future shareContent(String hashId, BuildContext context,
{String fileURL, String postText, String caption}) async {
String text =
"Check out this post!.\n ${postText == null ? '' : postText} \n $caption \n ${SHARE_URL}post/$hashId \n Download the App here. " +
(Platform.isIOS ? APP_STORE_LINK : PLAY_STORE_LINK);
String fileName = fileURL.split("?")[0];
RegExp regexp = RegExp(r"\.[a-zA-Z]*$", caseSensitive: false);
String timestamp = new DateTime.now().millisecondsSinceEpoch.toString();
String ext = regexp.stringMatch(fileName);
String mimeType = lookupMimeType(fileName);
var response = await get(imageURL);
ScopedModel.of<MainModel>(context, rebuildOnChange: true)
.setIsPostsLoading(false);
WcFlutterShare.share(
sharePopupTitle: 'share',
text: text,
fileName: "file" + timestamp + ext,
mimeType: mimeType,
bytesOfFile: response.bodyBytes);
}
The above code is generic for all 3 cases. @aarajput
Heyy @aarajput Any input would be highly appreciated.
Sorry @sakina1403 ! With which application you are trying to share audio file?
I am just glad you are replying :) At present I have tried with WhatsApp.
Sorry @sakina1403 ! I didnt get time to look into this myself. Try it with gmail and let me know. Because it could be whats app issue.
@sakina1403 Not being able to share text+audio in Whatsapp should be a limitation of Whatsapp. If you try to share text+audio with GMail, for example, it should work.
I am closing this issue as it seems to be issue with whats app only.