Skip to content
This repository has been archived by the owner on Jul 21, 2022. It is now read-only.

Text is not shown when sharing image on facebook or instagram #80

Open
ShamsFaraj opened this issue Oct 22, 2020 · 4 comments
Open

Text is not shown when sharing image on facebook or instagram #80

ShamsFaraj opened this issue Oct 22, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@ShamsFaraj
Copy link

Text is not shown when sharing image on facebook or instagram. But it's shown on messengers. How can I show text as text on facebook feed etc?

this is my method sample:

Future _shareImage(RenderRepaintBoundary imageObj) async {
try {
final image = await imageObj.toImage(pixelRatio: 5.0);
final ByteData byteData =
await image.toByteData(format: ImageByteFormat.png);
final pngBytes = byteData.buffer.asUint8List();
await Share.file('REBUSTA', 'esys.png', pngBytes, 'image/png',
text: 'www.rebusta.com');
} catch (e) {
print('error: $e');
}
}

@ShamsFaraj ShamsFaraj added the enhancement New feature or request label Oct 22, 2020
@hasnainelahi
Copy link

i also have same problem

@ShamsFaraj
Copy link
Author

In my case, the optional text was shown just fine on Android, but not in IOS. I used another plugin, result was also the same. So, I didn't used text for ios platform after all, like below:

if(Platform.isAndroid) {
  await Share.file('REBUSTA', 'esys.png', pngBytes, 'image/png', text: 'REBUSTA mobil oyununu pulsuz əldə et və Rebus Ustası adını qazan. \nwww.rebusta.az\n\n Kibrit.tech');
} else {
  await Share.file('REBUSTA', 'esys.png', pngBytes, 'image/png');
}

@hasnainelahi
Copy link

hasnainelahi commented Feb 23, 2021

I am using this code but not working on android. Only image sharing not with text. anyone can help me?

Future _shareImageFromUrl() async {
try {
var request = await HttpClient()
.getUrl(Uri.parse('https://media.sproutsocial.com/uploads/2017/02/10x-featured-social-media-image-size.png'));
var response = await request.close();
Uint8List bytes = await consolidateHttpClientResponseBytes(response);
await Share.file(
'ESYS AMLOG',
'amlog.png',
bytes,
'image/png',
text:'An MPG is a popular video format',
);
} catch (e) {
print('error: $e');
}
}

@kaushikgodhani
Copy link

https://pub.dev/packages/vocsy_esys_flutter_share

Use this Package its working on latest version

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants