Quantcast
Channel: Tweetinvi a friendly Twitter C# library
Viewing all articles
Browse latest Browse all 4126

New Post: [Stream API] Unable to listen for any events on WP8.1

$
0
0
Hi,

This does not seem to be working in the App.xaml, but if you put it in a View it works correctly. I remember reading about this.

So here is what I did (Visual Studio 2013) :
  • Create Pivot Universal Project
  • Install-Package TweetinviAPI (targeting Windows Phone project)
  • Open PivotPage.xaml
  • Edit the constructor as followed:
public PivotPage()
{
    this.InitializeComponent();

    this.NavigationCacheMode = NavigationCacheMode.Required;

    this.navigationHelper = new NavigationHelper(this);
    this.navigationHelper.LoadState += this.NavigationHelper_LoadState;
            
    this.navigationHelper.SaveState += this.NavigationHelper_SaveState;
    this.Loaded += OnLoaded;
}

privatevoid OnLoaded(object s, RoutedEventArgs routedEventArgs)
{
    TwitterCredentials.SetCredentials(...);
    var stream = Tweetinvi.Stream.CreateSampleStream();
    stream.TweetReceived += (sender, args) =>
    {
        Debug.WriteLine(args.Tweet);
    };

    stream.StartStreamAsync();
}
Done!

Viewing all articles
Browse latest Browse all 4126

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>