Take the 2-minute tour ×

I am building a Windows 8 app which allow sharing Image and text to Facebook and Twitter.

Can anyone tell me where to start or what the easiest way to do this is?

share|improve this question

5 Answers 5

up vote -1 down vote accepted

until facebook and twitter launch their win8 app. there is no easy way to do it except by using the api as per what you would do for other OS.

i am sure facebook app will arrive shortly.

i always imagine that microsoft would do something like windows phone which is to build fb capability into the OS.

share|improve this answer

The easiest way is to send email to your unique Facebook email address. Have a look here for more information.

share|improve this answer

The 'official' way would be to implement an event handler to the page's DataTransferManager's DataRequested event and fill in the DataPackage to respond to the user clicking the charm bar's share button.

This will let you share via Facebook/Twitter/email/message or whatever else you have linked to your People hub or to any other app that receives shares.

I have a short guide at http://coderwall.com/p/aeihvw

share|improve this answer

LINQ to Twitter supports WinRT: http://linqtotwitter.codeplex.com/

Check out TweetWithMedia. Here's an example:

static void TweetWithMediaDemo(TwitterContext twitterCtx)
    string status = "Testing TweetWithMedia #Linq2Twitter " + DateTime.Now.ToString(CultureInfo.InvariantCulture);
    const bool possiblySensitive = false;
    const decimal latitude = StatusExtensions.NoCoordinate; //37.78215m;
    const decimal longitude = StatusExtensions.NoCoordinate; // -122.40060m;
    const bool displayCoordinates = false;

    const string replaceThisWithYourImageLocation = @"..\..\images\200xColor_2.png";

    var mediaItems =
        new List<Media>
            new Media
                Data = Utilities.GetFileBytes(replaceThisWithYourImageLocation),
                FileName = "200xColor_2.png",
                ContentType = MediaContentType.Png

    Status tweet = twitterCtx.TweetWithMedia(
        status, possiblySensitive, latitude, longitude, 
        null, displayCoordinates, mediaItems, null);

    Console.WriteLine("Media item sent - Tweet Text: " + tweet.Text);
share|improve this answer

The easiest way is to use the share charm where user has the ability to decide which app to use to share the data, however there is no Facebook or Twitter app that I know of for Windows 8. You can also use the APIs directly - there are open-source libraries that make it fairly simple to post stuff to these services - you just need to get the libraries, apply for an application id from each service provider and integrate it with your apps. I am not sure if these libraries fully support Windows 8 though, so you might need to update them first.

Sample twitter use article about using twitter in WinRT (note - it's based on previous, Developer Preview build of Windows 8): http://advertboy.wordpress.com/2011/12/04/heres-my-twitter-library-to-get-you-quickly-building-winrt-xaml-net-apps-twitterwinrt/

share|improve this answer

Your Answer


