Skip to content Skip to sidebar Skip to footer

How To Share In This Format?

How to share icon,text,url of the app as shown in the above image? Icon should be sent from drawable, I have tried all the shareintents.putExtras() and etc.. nothing is working fo

Solution 1:

Short answer: This isn't your job, it's the shared-to app's job.

Explanation: Facebook created a protocol called Open Graph, which apps like Facebook and Whatsapp use to get info about the what image to be displayed and what text to show.

To be able to have something like your included picture, you'd have to first own the website you are sharing links to, then you'd have to include this meta data in your html:

<htmlprefix="og: http://ogp.me/ns#"><head><metaproperty="og:title"content="Text to be displayed." /><metaproperty="og:type"content="video.movie" /><metaproperty="og:url"content="Possibly a deep link to your app." /><metaproperty="og:image"content="Image to be displayed." 
/>
...
</head>
...
</html>

Finally in your android app you have to share a link to this website, possibly deep-linking into your app.

Post a Comment for "How To Share In This Format?"