social_share icon indicating copy to clipboard operation
social_share copied to clipboard

Twitter post issue

Open roberto701 opened this issue 3 years ago • 7 comments

I can't post image to twitter. It seems this library doesn't support yet. How can I solve it?

roberto701 avatar Jan 18 '22 22:01 roberto701

Same problem

MATTYGILO avatar Jan 29 '22 12:01 MATTYGILO

I can't share a simple text on iOS, is working fine on Android. I also tried without hashtags same issue.

My code:

  await SocialShare.shareTwitter(
      captionText,
      hashtags: defaultHashtags,
     );

Info.plist

<key>LSApplicationQueriesSchemes</key>
<array>
		<string>fbapi</string>
		<string>fb-messenger-share-api</string>
		<string>fbauth2</string>
		<string>fbshareextension</string>
		<string>https</string>
		<string>http</string>
		<string>mailto</string>
		<string>instagram-stories</string>
		<string>facebook</string>
		<string>facebook-stories</string>
		<string>instagram</string>
		<string>instagram-stories</string>
		<string>twitter</string>
		<string>whatsapp</string>
	</array>

juanagu avatar Feb 17 '22 15:02 juanagu

@juanagu me too,It just returns the data, but it doesn't open the Twitter app on ios. Android is ok.

CallMeIrving avatar Feb 18 '22 01:02 CallMeIrving

Mine also will not open the Twitter app.

DennisAshford avatar Feb 25 '22 18:02 DennisAshford

me too...

Tetsukick avatar Mar 12 '22 11:03 Tetsukick

@juanagu me too,It just returns the data, but it doesn't open the Twitter app on ios. Android is ok.

I made this workaround for iOS:

final hashtags = defaultHashtags.join(' #');

final message = '$captionText \n #$hashtags';
await urlLauncherHelper.openUrl(
    'twitter://post?'
    'message=${Uri.encodeComponent(message)}',
);

If you want to use the plugin for Android and add the workaround for iOS this is the code:


if (Platform.isAndroid) {
    await SocialShare.shareTwitter(
        captionText,
        hashtags: defaultHashtags,
    );
} else {
    final hashtags = defaultHashtags.join(' #');

    final message = '$captionText \n #$hashtags';
    await urlLauncherHelper.openUrl(
        'twitter://post?'
        'message=${Uri.encodeComponent(message)}',
    );
}

juanagu avatar Mar 22 '22 13:03 juanagu

fb-messenger-share-api

can you share in messenger? I need make this.

felipecastrosales avatar Feb 16 '23 17:02 felipecastrosales