문제

I have been searching for a way to create a share function that share an image and text in the same time and the answers i found is that WhatsApp can only share a single text or single image or single audio .. but in another hand i found that YouTube application is able to share text and image in the same time and in one message box as shown below:

youtube share result

So is anyone have an idea of how to do this?!.

And thank you in advance.

도움이 되었습니까?

해결책

WhatsApp actually recognize this link as a youtube link and gets the preview image of the video from youtube. WhatsApp and youtube probably made an arrangement between them, when WhatsApp recognize a youtube link it request the image from youtube servers and gets it. You can see that if you take only the link and send it, the image will be added by WhatsApp. unfortunately there is no way (that i know off) to share both an image and a text in WhatsApp.

Regards, Gili

다른 팁

Checking the answer from Gili, what I found out is the link that YouTube share has the follow format in the Extra Text:

https://youtu.be/prkQ6QFv-_Y

So, it is quite easy to parse it and by using the YouTube API for Java, it is possible to retrieve almost all the possible information about that video and build your own layout.

  1. Link one: How to register your app for YouTube to share the text and capture it: http://developer.android.com/training/sharing/receive.html

  2. Link two: YouTube Data API for Java https://developers.google.com/api-client-library/java/apis/youtube/v3

What I am not sure if all the version of YouTube shared text has the same format or not.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top