Twitter: Posting Tweets using WebBrowser
This article explains how to post a tweet using the Web Browser control
There are many ways of advertising an application, one of the best is to share the application between the user's friends. Posting on Twitter is a very easy and fast way of doing that, as you'll see in this article. As this article is really simple, the next section will describe all the needed steps to share an application using the Twitter.
Web Browser control is not the focus of this article, to see more details about it take a look at this article WebBrowser Control Techniques in Windows Phone.
- Put the WebBrowser control in your XAML page.
<phone:WebBrowser x:Name="webBrowser" Visibility="Collapsed"/>
- Call the following code in any button of your code behind page
webBrowser.Visibility = Visibility.Visible;
string text = "I'm using the Hello World application! Use you too! http://link-to-app-on-store";
webBrowser.Navigate(new Uri("https://twitter.com/intent/tweet?text=" + text));
The user will have to login on Twitter once before share your application. Let he know that your application will not keep his password saved, despite the fact he is going to do this only one time.
A different approach
Vaishali Rawat shown a very good approach in this article (Twitter: Posting Tweets using Hammock) to do the same, using the Hammock library. If the Twitter interface is not an option or you need to keep logged on Twitter between the application pages, the Hammock library is a better option.