Sharing Link on LinkedIn from Flutter and Web gives different results

108 views Asked by At

I am trying to share a Link of webpage on LinkedIn from my Flutter app, I have created below function for that:

void _shareOnLinkedIn() async {
final String linkedInShareUrl =
    "https://stgappnavigator.parkstreet.com/marketplace/details/${_catalogStore.summaryInfo?.data?[widget.productIndex].id}";
final String encodedUrl = Uri.encodeFull(linkedInShareUrl);
final String linkedInUrl = Const.linkedInShareUrl + "=$encodedUrl";
if (await canLaunchUrl(Uri.parse(linkedInUrl))) {
  await launchUrl(Uri.parse(linkedInUrl));
} else {
  ToastUtil.show(
      ToastDecorator(isSuccess: false, msg: "something_went_wrong".tr()),
      context,
      gravity: ToastGravity.bottom);
    }
}

Now, Its working fine but the result which I am getting is different on LinkedIn in case of Web and Mobile..i.e. While Sharing from Web and from Mobile It shares the same String value of the Link but it looks different on LinkedIn as below:

enter image description here

The Blue text is the result of Sharing from Mobile and The second one is the same link which is shared from web but it looks different.

The Link value is the same even though why is it looking different on LinkedIn.

Please guide.

Note that the value of linkedInShareUrl variable is : https://www.linkedin.com/sharing/share-offsite/?url

0

There are 0 answers