Android - share youtube link, omit URL in message

android
fabric

#1

I’m developing an Android app, and want to implement sharing Youtube links via twitter.
I want to post a tweet showing player card with shared video, containing some text description, but no visible URL in the message body (as URL is redundant when player card is visible). For now, my tweets are posted correctly and player card is visible, but URL is always appended to the message. I’ve tried sending Android Intent to Twitter App and using Fabric, in both cases the URL is always appended (code below).

using Android Intent:

 String tweetUrl =
        String.format("https://twitter.com/intent/tweet?text=%s&url=%s",
              urlEncode(description), urlEncode(url));
        Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(tweetUrl));
 startActivity(shareIntent);

using Fabric:

TweetComposer.Builder builder = new TweetComposer.Builder(parentActivity)
.text(urlEncode(description))
.url(new URL(urlEncode(url)));
builder.show();

Is there a way to stop URL being appended to the message (or at least to make it invisible), but the link still being shared (and player card visible) ?


#2

The YouTube link appears because a link was shared, Twitter indexed the link, and extracted information from the link about how the content should be previewed on Twitter. The link should appear in the source Tweet to generate the card.

A Twitter client (Twitter.com, Twitter for Android, etc.) might choose not to display a link if its content is sufficiently contained in the card (image, video, etc.).


#3