locked
How to share image and text in the share contract RRS feed

  • Question

  • Hi,

    I want to share a movie( title and link of the movie ) from my app to another apps ( whatsapp,facebook etc ) for that i have used following code. but How can i add image to that share if i have web url of the image ( https://i.ytimg.com/vi/J-wiPP76FqQ/mqdefault.jpg ). Please help me

    private void RegisterForShare()
            {
                DataTransferManager dataTransferManager = DataTransferManager.GetForCurrentView();
                dataTransferManager.DataRequested += new TypedEventHandler<DataTransferManager,
                    DataRequestedEventArgs>(this.ShareTextHandler);
            }
    
            private void ShareTextHandler(DataTransferManager sender, DataRequestedEventArgs e)
            {
                DataRequest request = e.Request;
                request.Data.Properties.Title = shareContent;
                request.Data.SetWebLink(videoId); 
            }
            public async Task share(string content, string videoId)
            {
                RegisterForShare();
                this.shareContent = "Watch " + content + " on ";
                this.videoId = new Uri("http://www.youtube.com/watch?v=" + videoId);
                DataTransferManager.ShowShareUI();
            }

    Thank you

    Sunday, January 25, 2015 9:50 AM

Answers

All replies